I have started a process execution in my Java code
pro=Runtime.getRuntime().exec(rootDirectory+"abc.exe", null, new File(rootDirectory));
If I forcibly terminate the Java code running in the middle, this exe file should also terminate. But I seen this exe still running background.
How to auto-terminate this exe if I manually terminate the Java code running?
I tried this: The above code is in try block. Written this code in catch: pro.destroy();
: didn't work.
Kept in finally block: didn't work. It's still running background.
Please help.