• <tfoot id='JZEuL'></tfoot>
  • <legend id='JZEuL'><style id='JZEuL'><dir id='JZEuL'><q id='JZEuL'></q></dir></style></legend>

    <small id='JZEuL'></small><noframes id='JZEuL'>

      <bdo id='JZEuL'></bdo><ul id='JZEuL'></ul>

        <i id='JZEuL'><tr id='JZEuL'><dt id='JZEuL'><q id='JZEuL'><span id='JZEuL'><b id='JZEuL'><form id='JZEuL'><ins id='JZEuL'></ins><ul id='JZEuL'></ul><sub id='JZEuL'></sub></form><legend id='JZEuL'></legend><bdo id='JZEuL'><pre id='JZEuL'><center id='JZEuL'></center></pre></bdo></b><th id='JZEuL'></th></span></q></dt></tr></i><div id='JZEuL'><tfoot id='JZEuL'></tfoot><dl id='JZEuL'><fieldset id='JZEuL'></fieldset></dl></div>
      1. 任何“重启"的方式JVM?

        Any way to quot;rebootquot; the JVM?(任何“重启的方式JVM?)

        1. <small id='wfaEl'></small><noframes id='wfaEl'>

                  <tbody id='wfaEl'></tbody>
                  <bdo id='wfaEl'></bdo><ul id='wfaEl'></ul>

                • <legend id='wfaEl'><style id='wfaEl'><dir id='wfaEl'><q id='wfaEl'></q></dir></style></legend><tfoot id='wfaEl'></tfoot>
                  <i id='wfaEl'><tr id='wfaEl'><dt id='wfaEl'><q id='wfaEl'><span id='wfaEl'><b id='wfaEl'><form id='wfaEl'><ins id='wfaEl'></ins><ul id='wfaEl'></ul><sub id='wfaEl'></sub></form><legend id='wfaEl'></legend><bdo id='wfaEl'><pre id='wfaEl'><center id='wfaEl'></center></pre></bdo></b><th id='wfaEl'></th></span></q></dt></tr></i><div id='wfaEl'><tfoot id='wfaEl'></tfoot><dl id='wfaEl'><fieldset id='wfaEl'></fieldset></dl></div>
                • 本文介绍了任何“重启"的方式JVM?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  有没有办法重启JVM?如实际上并没有退出,而是关闭并重新加载所有类,然后从顶部运行 main?

                  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?

                  推荐答案

                  最好的办法可能是在循环中运行 java 解释器,然后退出.例如:

                  Your best bet is probably to run the java interpreter within a loop, and just exit. For example:

                  #!/bin/sh
                  while true
                  do
                      java MainClass
                  done
                  

                  如果您希望能够完全重启或关闭,您可以测试退出状态:

                  If you want the ability to reboot or shutdown entirely, you could test the exit status:

                  #!/bin/sh
                  STATUS=0
                  while [ $STATUS -eq 0 ]
                  do
                      java MainClass
                      STATUS=$?
                  done
                  

                  在 java 程序中,您可以使用 System.exit(0) 表示您要重新启动",并使用 System.exit(1) 表示您要停止并保持停止状态.

                  Within the java program, you can use System.exit(0) to indicate that you want to "reboot," and System.exit(1) to indicate that you want to stop and stay stopped.

                  这篇关于任何“重启"的方式JVM?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  How to send data to COM PORT using JAVA?(如何使用 JAVA 向 COM PORT 发送数据?)
                  How to make a report page direction to change to quot;rtlquot;?(如何使报表页面方向更改为“rtl?)
                  Use cyrillic .properties file in eclipse project(在 Eclipse 项目中使用西里尔文 .properties 文件)
                  Is there any way to detect an RTL language in Java?(有没有办法在 Java 中检测 RTL 语言?)
                  How to load resource bundle messages from DB in Java?(如何在 Java 中从 DB 加载资源包消息?)
                  How do I change the default locale settings in Java to make them consistent?(如何更改 Java 中的默认语言环境设置以使其保持一致?)
                    <tbody id='L5vUX'></tbody>
                  • <legend id='L5vUX'><style id='L5vUX'><dir id='L5vUX'><q id='L5vUX'></q></dir></style></legend>
                  • <i id='L5vUX'><tr id='L5vUX'><dt id='L5vUX'><q id='L5vUX'><span id='L5vUX'><b id='L5vUX'><form id='L5vUX'><ins id='L5vUX'></ins><ul id='L5vUX'></ul><sub id='L5vUX'></sub></form><legend id='L5vUX'></legend><bdo id='L5vUX'><pre id='L5vUX'><center id='L5vUX'></center></pre></bdo></b><th id='L5vUX'></th></span></q></dt></tr></i><div id='L5vUX'><tfoot id='L5vUX'></tfoot><dl id='L5vUX'><fieldset id='L5vUX'></fieldset></dl></div>

                    <small id='L5vUX'></small><noframes id='L5vUX'>

                    • <bdo id='L5vUX'></bdo><ul id='L5vUX'></ul>
                      <tfoot id='L5vUX'></tfoot>