• <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?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

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

                  相关文档推荐

                  Bytecode features not available in the Java language(Java 语言中不可用的字节码功能)
                  ClassCastException because of classloaders?(ClassCastException 因为类加载器?)
                  How can I add a Javaagent to a JVM without stopping the JVM?(如何在不停止 JVM 的情况下将 Javaagent 添加到 JVM?)
                  Cannot load 64-bit SWT libraries on 32-bit JVM ( replacing SWT file )(无法在 32 位 JVM 上加载 64 位 SWT 库(替换 SWT 文件))
                  Encourage the JVM to GC rather than grow the heap?(鼓励 JVM 进行 GC 而不是增加堆?)
                  Why a sawtooth shaped graph?(为什么是锯齿形图形?)
                    <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>