can I run more than one JVM on my single PC?

前端 未结 7 1083
暖寄归人
暖寄归人 2020-12-14 23:07

Can I run more than one JVM? If yes then how can I find a particular class is loaded on which JVM?

7条回答
  •  星月不相逢
    2020-12-14 23:54

    Multiple JRE (Java Runtime Enviroment) is very possible. I do so. The thing is JVM does not always run on your system. It is like any other software. When you run a jar file, it starts running.

    The default JRE is set in Environment Variables as JAVA_HOME (right click my computer -> properties -> advanced tab -> Environment Variables)

    To run a jar file you simply run this command:

    C:\Program Files\Java\j2re1.4.2_04\bin\javaw.exe" -jar Myfile.jar

    You can use any other jre javaw to run a jar file.

    Please note that j2re1.4.2_04 may not be your jre version.

    Edit:

    All classes in a jar file run on a single JVM. As you may guess. See your JAVA_HOME, it is the default.

提交回复
热议问题