Catch when java process has been terminated

后端 未结 4 538
有刺的猬
有刺的猬 2021-01-13 20:50

How can I catch when somebody kills my application (java, but it is not important) by taskmanager or by taskkill console command?

I understand that I cannot catch t

4条回答
  •  谎友^
    谎友^ (楼主)
    2021-01-13 21:40

    you can use a second application that will run on the local machine and monitor your main application. when the main application goes down it can do something (e.g restart it, log the event) c

提交回复
热议问题