I have see two jre in the java folder one in jdk and one outside jdk. Can you tell me the what is the reason behind having these two jre?
-
1http://stackoverflow.com/questions/2541319/jre-included-with-jdk-vs-standalone-jre – Jayan Feb 23 '12 at 06:16
4 Answers
I didn't read your answer right and searched a little, here's an answer from somebody who seems to be Oracle staff:
There are some differences which may explain what you are seeing. The JRE that is included with the JDK does not support Auto Update and it does not contain any product offerings as the standalone JRE does. The JRE and JDK are both built at the same time (approximately) from the source base.
from https://forums.oracle.com/forums/thread.jspa?threadID=2277801
Old Answer 32/64 Bit Windows
If you are on Windows 7 64 Bit (or maybe other MS 64 Bit Systems) you need 2 JRE's. One for your 64 Bit Applications (Browser) and one for 32 Bit. They should have distinct Folder Names, ie: 64 Bit C:\Program Files\java\jre7 32 Bit C:\Program Files (x86)\java\jre7

- 5,173
- 5
- 30
- 51
-
May you please explain me what kind of Auto update and what is product offerings? – Naveen Chauhan Feb 23 '12 at 10:09
-
I'm no Oracle employee so I really don't know if this information is correct. But I think autoupdate is, well, the automatic update of the JRE and product offerings are ads? – wintersolutions Feb 23 '12 at 10:49
-
The difference is really that the public JRE (C:\Program Files\Java\jre7) supports auto update, the JRE in the JDK (C:\Program Files\Java\jdk1.7.0_65\jre) doesn't which maybe important for not switching version while developing Java. – 98percentmonkey Jul 31 '14 at 12:15
If you're just running an application you only need the Java Runtime Environment (JRE), so it make sense to deliver that as a distinct entity.
If you are developing the you need the complete Java Development Kit, and it's helpful to have everything you need including the JRE.
So, two usage scenarios, two ways to get the JRE.
See the question referenced by Jaya for more information.

- 54,992
- 14
- 74
- 117
-
3I know their difference, but when you install a JDK, it installs 2 JREs, one inside the JDK and one standalone one, why is that? – Amir Pashazadeh Feb 23 '12 at 06:39
If you are developing a java program then compile time private jre
(C:\Program Files\Java\jdk1.7.0_65\jre) will be used and running time public jre
(C:\Program Files\Java\jre7) will be used.This is the default use case scenario.If compile time jvm finds that private
jre is not there then it will go for public
jre and run time also if jvm finds that if public
jre is not there then it will go for private
jre.

- 39,603
- 20
- 94
- 123

- 732
- 7
- 20
The JDK is required for developing Java applications, but it includes a JRE (Java Runtime Environment) which is required in order to run Java applications.
If you're an advanced user and you know what you're doing then you only need one copy of the JRE, meaning that you do not need the "Public JRE" in addition to the one that comes with the JDK.
Simply set your Environment variable JAVA_HOME
to point to the JDK installation directory, and add the JRE's bin
directory, i.e. %JAVA_HOME%\jre\bin
, to your PATH
.
If you want Java to notify/remind/annoy you about updates, and have an extra 200MB of disk space that you don't need, then install the public JRE too.

- 21,295
- 13
- 115
- 116