Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the reason behind putting two jre, one in jdk and one outsite jdk in the java folder in Program files

Tags:

java

jdk1.6

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?

like image 959
Naveen Chauhan Avatar asked Feb 23 '12 06:02

Naveen Chauhan


3 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

like image 97
wintersolutions Avatar answered Oct 21 '22 04:10

wintersolutions


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.

like image 31
djna Avatar answered Oct 21 '22 03:10

djna


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.

like image 29
anirban karak Avatar answered Oct 21 '22 04:10

anirban karak