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

    <bdo id='gD4VC'></bdo><ul id='gD4VC'></ul>
    <i id='gD4VC'><tr id='gD4VC'><dt id='gD4VC'><q id='gD4VC'><span id='gD4VC'><b id='gD4VC'><form id='gD4VC'><ins id='gD4VC'></ins><ul id='gD4VC'></ul><sub id='gD4VC'></sub></form><legend id='gD4VC'></legend><bdo id='gD4VC'><pre id='gD4VC'><center id='gD4VC'></center></pre></bdo></b><th id='gD4VC'></th></span></q></dt></tr></i><div id='gD4VC'><tfoot id='gD4VC'></tfoot><dl id='gD4VC'><fieldset id='gD4VC'></fieldset></dl></div>

      <legend id='gD4VC'><style id='gD4VC'><dir id='gD4VC'><q id='gD4VC'></q></dir></style></legend>

    1. <tfoot id='gD4VC'></tfoot>

      JVM 是否可以同时运行多个程序?

      时间:2023-08-24
        <tbody id='D4mDx'></tbody>

        • <bdo id='D4mDx'></bdo><ul id='D4mDx'></ul>

          1. <legend id='D4mDx'><style id='D4mDx'><dir id='D4mDx'><q id='D4mDx'></q></dir></style></legend>
          2. <tfoot id='D4mDx'></tfoot>

            • <small id='D4mDx'></small><noframes id='D4mDx'>

              1. <i id='D4mDx'><tr id='D4mDx'><dt id='D4mDx'><q id='D4mDx'><span id='D4mDx'><b id='D4mDx'><form id='D4mDx'><ins id='D4mDx'></ins><ul id='D4mDx'></ul><sub id='D4mDx'></sub></form><legend id='D4mDx'></legend><bdo id='D4mDx'><pre id='D4mDx'><center id='D4mDx'></center></pre></bdo></b><th id='D4mDx'></th></span></q></dt></tr></i><div id='D4mDx'><tfoot id='D4mDx'></tfoot><dl id='D4mDx'><fieldset id='D4mDx'></fieldset></dl></div>
                本文介绍了JVM 是否可以同时运行多个程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                JVM 可以同时运行多个程序吗?如果是这样,怎么做?如果不是,为什么?

                Is it possible for a JVM to run more than one program at the same time? If so, how? If not, why?

                要运行程序,我们只需这样做

                To run a program, we simply do

                java ProgramName
                

                但是我们可以使用同一个 JVM 实例来运行另一个程序吗?

                But can we use the same JVM instance to run another program?

                推荐答案

                答案取决于你对程序"的定义.具有 main 方法并且以 java NameOfClass 开头的 Java 程序通常不能在同一个 JVM 中运行,因为没有内置的资源或命名空间分离.例如,如果两个程序使用相同库的冲突版本怎么办?

                The answer depends on your definition of "program." The Java programs that have a main method and that you start with java NameOfClass typically cannot be run in the same JVM because there's no builtin separation of resources or namespaces. For example, what if the two programs use conflicting versions of the same library?

                我们还有旨在共享 JVM 的应用程序,例如企业应用程序.这些程序旨在在应用程序服务器"的上下文中运行,该程序基本上是用于运行其他程序的程序.应用程序服务器使用类加载器和安全管理器将应用程序资源分开.例如,由于通过不同的类加载器加载,两个应用程序可能使用冲突的库版本或冲突的类名,但仍然共享一个 JVM.

                We also have applications that are designed to share a JVM, such as enterprise applications. These are programs that are designed to run in the context of an "application server", which is basically a program for running other programs. An application server keeps the applications resources separate using classloaders and security managers. For example, two applications may use conflicting versions of a library or conflicting class names and still share a JVM thanks to being loaded through different classloaders.

                这篇关于JVM 是否可以同时运行多个程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                上一篇:即使坏人试图抓住它,我如何在任何 OutOfMemoryException 上使 JVM 退出 下一篇:假设我知道我将在 x64 cpus 上运行,我可以忽略哪些 JVM 同步实践?

                相关文章

                1. <legend id='6AfC6'><style id='6AfC6'><dir id='6AfC6'><q id='6AfC6'></q></dir></style></legend>
                2. <tfoot id='6AfC6'></tfoot>
                  <i id='6AfC6'><tr id='6AfC6'><dt id='6AfC6'><q id='6AfC6'><span id='6AfC6'><b id='6AfC6'><form id='6AfC6'><ins id='6AfC6'></ins><ul id='6AfC6'></ul><sub id='6AfC6'></sub></form><legend id='6AfC6'></legend><bdo id='6AfC6'><pre id='6AfC6'><center id='6AfC6'></center></pre></bdo></b><th id='6AfC6'></th></span></q></dt></tr></i><div id='6AfC6'><tfoot id='6AfC6'></tfoot><dl id='6AfC6'><fieldset id='6AfC6'></fieldset></dl></div>
                3. <small id='6AfC6'></small><noframes id='6AfC6'>

                      <bdo id='6AfC6'></bdo><ul id='6AfC6'></ul>