Hello !
I want to start to start other programs from my java program. To do this I use the following code:
.
.
Runtime rt = Runtime.getRuntime();
proc = rt.exec(progName);
proc.waitFor();
.
.
When I end my program I also want all the programs started
by my program to be ended too. I tried
.
proc.destroy();
.
This works fine for real executables, but does not for
shell scripts that again start java programs. With those
my program ends but the others keep running.
Is there any way to kill all sub processes? the problem is
the program should be able to run on Linux and Windows.
Thanks
I want to start to start other programs from my java program. To do this I use the following code:
.
.
Runtime rt = Runtime.getRuntime();
proc = rt.exec(progName);
proc.waitFor();
.
.
When I end my program I also want all the programs started
by my program to be ended too. I tried
.
proc.destroy();
.
This works fine for real executables, but does not for
shell scripts that again start java programs. With those
my program ends but the others keep running.
Is there any way to kill all sub processes? the problem is
the program should be able to run on Linux and Windows.
Thanks