I need to spawn a process in Java (under Linux exclusively) that will continue to run after the JVM has exited. How can I do this?
Basically the Java app should spawn an updater which stops the Java app, updates files and then starts it again.
I’m interested in a hack & slash method to just get it working as well as a better design proposal if you have one 🙂
If you’re spawning the process using
java.lang.Processit should ‘just work’ – I don’t believe the spawned process will die when the JVM exits. You might find that the Ant libraries make it easier for you to control the spawning though.