I launch a child process in Java as follows:
final String[] cmd = {\"\"};
Process process = Runtime.getRuntime().exec(cmd);
>
Adding shutdown hook is not a reliable method to kill the child processes. This is because Shutdown hook might not necessarily be executed when a force kill is performed from Task Manager.
One approach would be that the child process can periodically monitor the PID of its parent. This way, Child process can exit itself when the parent exits.