there is a process Process process = Runtime.getRuntime().exec(String.format("cmd /c %s", command ));
This process spawns other processes, for example, java ... is called from bat , which runs as another process.
If from the CMD console terminate, then all processes are stopped, if you execute process.destroy() , then the CMD stops, and the java process hangs.
How to get java "child" processes, which generates the essence of the process ?