What are the differences between private jre and public jre?

后端 未结 4 545
暖寄归人
暖寄归人 2021-02-06 23:55

What are the differences between private jre and public jre? Is there some official paper about this topic?

I didn\'t find any question on SO about this topic. Nor I was

相关标签:
4条回答
  • 2021-02-07 00:29

    The answer is very simple: the public JRE is the one users will use if they want to run anything Java. The private JRE is a different installation that one can use, if the explicitly execute that Java binary (e.g. on Windows: "C:\Programs\Java\MyJava\bin\java.exe").

    0 讨论(0)
  • 2021-02-07 00:32

    The official answer, from Oracle:

    Private Versus Public JRE

    Installing the JDK also installs a private JRE and optionally a public copy. The private JRE is required to run the tools included with the JDK. It has no registry settings and is contained entirely in a jre directory (typically at C:\Program Files\jdk1.8.0\jre) whose location is known only to the JDK. On the other hand, the public JRE can be used by other Java applications, is contained outside the JDK (typically at C:\Program Files\Java\jre1.8.0), is registered with the Windows registry (at HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft), can be removed using Add/Remove Programs, might be registered with browsers, and might have the java.exe file copied to the Windows system directory (which would make it the default system Java platform).

    0 讨论(0)
  • 2021-02-07 00:38

    Private JRE ->Private JRE is Used for compilation of Java Application when both Public and private JRE is available and its installation location is defined by user.

    Public JRE -> Public JRE is used for Execution of Java Application when both Public and private JRE is available....if in case Private JRE is not available then both Compilation and Execution process will be done by Public JRE.

    0 讨论(0)
  • 2021-02-07 00:55

    A JRE is nothing but a folder that contains JVM executables, setting files, required lib files, and extensions. You can install multiple JREs on your system Sun generally installs versions in C:\Program Files\Java as jre eg.jre1.6.0_06.

    A Public JRE is available to all Java programs, Browsers, and the libs in this JRE folder are available to applications started in command line like java com.sarathonline.cli.HelloWorld This JRE is also registered in path, and Browser plugin.

    A Private JRE is something that is installed in the system but is not referred to by default. This could be a copy of the JRE / JDK folder from another installed directory. If you see a my earlier post: starting eclipse with jre 1.6 where your environment is in 1.4, The JRE1.6 is used only by Eclipse, this is a private JRE. While the JAVA_HOME points to 1.4. This is a public JRE.

    Source:

    http://blog.sarathonline.com/2008/07/public-and-private-jre.html

    Some more discussion on the topic:

    http://www.velocityreviews.com/forums/t649860-private-vs-public-jre-in-different-oss.html

    0 讨论(0)
提交回复
热议问题