[英]Is it possible to collect information about a running .jar file when it exits?
is it possible to gather information on all the existing variables within a running .jar file when it exits? 是否可以在退出时收集正在运行的.jar文件中所有现有变量的信息? I'm running an application on the linux command line of various servers and I try to debug an issue when the jar just stops working on 10% of the systems. 我正在各种服务器的linux命令行上运行一个应用程序,当jar只是停止在10%的系统上运行时,我尝试调试一个问题。
In Android, there is a method called onDestroy()
which can be overwritten in order to perform tasks when the app exits. 在Android中,有一个名为onDestroy()
的方法,可以覆盖该方法,以便在应用程序退出时执行任务。 Is there something similar possible in native Java applications? 在本机Java应用程序中是否存在类似的可能性? And even if that is the case, how could I collect the data? 即使是这种情况,我如何收集数据?
In Android, there is a method called
onDestroy()
.. 在Android中,有一个名为onDestroy()
的方法。
Add a shutdown hook . 添加一个关闭钩子 。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.