Reputation: 49329
As the title suggests is it possible to execute another java app from within a java app and keep the children running after main application quits?
Upvotes: 5
Views: 2442
Reputation: 37778
If you want to quit the JVM together with the main application, then use Fortega's suggestion (it's probably the best way to do it)!
There's also another approach, if you don't want to create new processes: You could run everything in a separate Thread, also the "main application". This would not exit the Java Virtual Machine, and the threads would run until they're finished (except if you set them up as Daemon threads).
Upvotes: 0
Reputation: 19682
I guess you could do
Runtime.getRuntime().exec(command);
where command is a java command
Upvotes: 3