I need to restart a JavaFX Application, which is a standalone desktop application launched by a single JAR, by a specific action within the application that throws a specific exit code upon closure of said application. This could be a button, dialog, what-have-you, I just need it to exit the program while setting the exit code to something specific to designate that restarting the application is what I desire upon exit.
I'm going off of this question: Restart an Application in JavaFx
I have zero idea how to set the exit code in JavaFX, and can't find it in the Platform or Application classes. I'm not even sure if this is the best way to restart a JavaFX application which is deployed in the manner I described above. Any help is greatly appreciated. Also, the application is run on Ubuntu 14, for the most part.