3

Consider the following:

new ProcessBuilder(pathToSomeExectuable).start();

What will happen when the current Java application will be closed? In other words, is the Process running as daemon and will automatically closed? Or, do I need to call destroy()?

IsaacLevon
  • 2,260
  • 4
  • 41
  • 83
  • if you're on linux run `watch "ps aux | grep myExecutableName"` then start you're program `new ProcessBuilder(pathToSomeExectuable).start();` and then monitor what happens once the java application has terminated. If it is still alive you need to make an exit call manually otherwise not. If you're on windows use the task manager – Virgula Sep 01 '20 at 12:08

1 Answers1

1

[At least on linux] the subprocess aren't automatically terminated when the parent process exits.

Read these resources for more information:

Juraj Martinka
  • 3,991
  • 2
  • 23
  • 25