tags:

views:

316

answers:

3

When i am installing JDK(TM) Update 10, it installs the following four features :

-> Development Tools

-> Demos and Samples

-> Source Code

-> Java DB

With last three features, i have no probz at all.


Now Development tools contains :-

  1. java devlopment kit (to develop java applications, here jdk1.6.0_10)
  2. public jre (which is always required if u want to run java applications regardless of jdk, here jre6)

jdk (jdk1.6.0_10) contains : jre, bin, etc..etc...

jre directory also have a bin directory.


On my windows machine i have set the path value :-

path=C:\Program Files\Java\jdk1.6.0_10\bin;.;

It means I am using javac.exe of jdk1.6.0_10\bin for compiling .java files and

java.exe also from jdk1.6.0_10\bin and not of jdk1.6.0_10\jre\bin for interpretting .class files.

javaw.exe also from jdk1.6.0_10\bin and not of jdk1.6.0_10\jre\bin for interpretting .class files.

In addition jdk1.6.0_10\bin also have appletviewer.exe, jar.exe, jarsigner.exe, java-rmi.exe, javadoc.exe, javap.exe, rmic.exe, rmiregistry.exe which i frequently use, some more exe's.

*Also both jdk1.6.0_10\bin, jdk1.6.0_10\jre\bin have some common as well as different exe's.*


If a developer want to develop and test java applications, jdk1.6.0_10\bin is more then sufficient (as it contains all the above exe's mentioned in BOLD), and if a user wants to use java applications, then a public jre is more then sufficient (which ships with JDK, if u are not a developer or not have JDK installed, u can also download it seperately).

Now the point which i am not getting is that,

-> when all the exe's for runtime (java.exe, javaw.exe) or required for binding (rmiregistry.exe) (mentioned above in BOLD + ITALIC) are present in jdk1.6.0_10\bin,

The point which is confusing me is,

Why jdk provides a jre inside jdk1.6.0_10 directory???

+2  A: 

The JRE directory contains the files you can redistribute with your application, should you choose to (see jre/README.txt).

McDowell
thnx Mr McDowell, some detailed explanation or reference on web is greatly appreciated. :-)
rits
@rits: Just look on your harddisk.
Aaron Digulla
http://java.sun.com/javase/6/webnotes/install/jre/README
McDowell
+2  A: 

It's kind of hard to understand what you are really asking, but java.exe inside the jdk\bin and jdk\jre\bin are identical:

C:\Program Files\Java\jdk1.6.0_13>md5sum bin\java.exe
\ee21961559a99f6ab3967e709563cc03 *bin\\java.exe

C:\Program Files\Java\jdk1.6.0_13>md5sum jre\bin\java.exe
\ee21961559a99f6ab3967e709563cc03 *jre\\bin\\java.exe

I think you are really asking "If you install the JDK, what is the point of also installing a contained JRE within it?". I think you'd have to ask Sun to really get the correct answer, but I assume it's for anyone that wants to run/test their applications (that they are developing) on the JRE environment instead of the full-blown JDK environment.

matt b
A: 

There are a couple of identical files but the main reason for having a JRE inside of a JDK is the jre\lib\ directory which contains most of the things you need to run Java, mainly the DLLs and rt.jar which contains the main class files.

In order to cut down on installed file size, the JDK commands will look into jre\lib\, too.

The guys at Sun duplicated a few files in bin\ to make your life more simple: It's often sufficient just to have the JDK bin directory in your PATH instead of both.

PS: The installer also put a copy of java.exe in the Windows\system32\ directory.

Aaron Digulla