Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Runtime.exec - Terminate java code but not process

807580Aug 12 2009 — edited Aug 13 2009
Hi

I've figured out how to start an external program, but I can't seem to find out how to terminate my java program without having to kill the started process.
Runtime rt = Runtime.getRuntime();
Process p = rt.exec("C:\\Program Files (x86)\\VideoLAN\\VLC\\vlc.exe");

System.exit(0)
That won't work, it only works when I do this:
Runtime rt = Runtime.getRuntime();
Process p = rt.exec("C:\\Program Files (x86)\\VideoLAN\\VLC\\vlc.exe");
p.destroy();
System.exit(0)
But that's not what I want. I want to end my program and continue to run the external program. How to do this?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 10 2009
Added on Aug 12 2009
13 comments
1,180 views