Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

JDK Private JRE vs Public JRE  RSS feed

 
J Solomon
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not sure where else to post this one. I'm currently working with Java6 in a Windows XP (awful by the way) env. When you install the JDK, you have an option to install the public JRE. Now from what I gather, a private JRE is installed within the JDK dir by default and this is the JRE that the java tools such as 'javac' use. I would normally set up JAVA_HOME variable to point to JDK installation, C:\Program Files\Java\jdk1.6.0_12, but I have other applications that use the JAVA_HOME var to run java apps. Should I also install the public JRE? And are these apps going to use the public JRE, or will they use the private JRE because of how JAVA_HOME is defined? I am a little confused by the whole public vs private JRE thing. Any help would be greatly appreciated. Thanks.
 
colton peterson
Ranch Hand
Posts: 97
Linux Python VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I myself wasn't even aware there was a public or private JRE, but a quick google search turns up this. He does a pretty good job of explaining the differences, basically the public JRE is the one you want everything else on the computer to use, and a private JRE is just if you need to have multiple versions of the JRE on the computer.
 
J Solomon
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
colton peterson wrote:I myself wasn't even aware there was a public or private JRE, but a quick google search turns up this. He does a pretty good job of explaining the differences, basically the public JRE is the one you want everything else on the computer to use, and a private JRE is just if you need to have multiple versions of the JRE on the computer.


So I read that post and understand what the writer was trying to convey. My issue is, if you install the JDK and set your JAVA_HOME variable to point to your JDK install path, then whenever you issue any command such as "java ....", then anything that uses JAVA_HOME is going to source the version of java that lives in the JDK path (the private one)? After a a little tinkering, I've noticed that if you install the public JRE as well, it looks like Windows does some fundangled thing and sets the JRE's path somewhere in the registry or what not so that the public JRE is sourced before we hit JAVA_HOME in the path.
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!