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?
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
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With