需要关闭Java打开的进程吗?

huangapple go评论71阅读模式
英文:

Do you need to close a process opened by Java?

问题

当当前的Java应用程序被关闭时会发生什么?换句话说,Process是否作为守护进程运行并会自动关闭?或者,我需要调用destroy()方法?

英文:

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()?

答案1

得分: 1

[至少在Linux上] 当父进程退出时,子进程不会自动终止。

阅读以下资源以获取更多信息:

英文:

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

Read these resources for more information:

huangapple
  • 本文由 发表于 2020年9月1日 17:53:40
  • 转载请务必保留本文链接:https://go.coder-hub.com/63685372.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定