1

I have a GUI that has many buttons. Each button creates a Process (ProcessBuilder.start()) that send of a predetermined ClearCase command with pre-set arguments.

After calling ProcessBuilder.start(), I add the process to a list. When the program shuts down, I iterate through this list and call destroy() on each process. I'm using Runtime.getRuntime().addShutdownHook() to try to iterate through my list.

However, when I look in Windows Task Manager, I see that some conhost.exe and cleartool.exe processes are still alive. I suspect Process.destroy() is either not working or not propagating. Is there a way to completely clean up the program and kill all subprocesses when the user clicks X?

1 Answers1

0

see: Killing a process using Java

But be aware that if the process that you invoke creates new sub-processes, those may not be terminated (see http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4770092).

Community
  • 1
  • 1