Any way to “reboot” the JVM?

后端 未结 8 1009
难免孤独
难免孤独 2020-12-05 17:46

Is there any way to reboot the JVM? As in don\'t actually exit, but close and reload all classes, and run main from the top?

8条回答
  •  执念已碎
    2020-12-05 18:07

    If you're working in an application server, they typically come with built-in hot deployment mechanisms that'll reload all classes in your application (web app, enterprise app) when you redeploy it.

    Otherwise, you'll have to look into commercial solutions. Java Rebel (http://www.zeroturnaround.com/javarebel/) is one such option.

提交回复
热议问题