mogli
mogli

Reputation: 1609

Why 2 bins for exe's in jdk?

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???

Upvotes: 2

Views: 2368

Answers (5)

Peter Molnar
Peter Molnar

Reputation: 121

The answer to the question can be found here:

http://www.oracle.com/technetwork/java/javase/documentation/install-windows-142126.html#private

The private JRE in jdk1.6.0_10\jre\bin is used by the applications bundled with the JDK. It should be left alone.

Upvotes: 0

dsynkd
dsynkd

Reputation: 2145

JRE is the Java Runtime Environment and also comes with the java program that redirects the applications that require the use of java. When you request a web page that needs java, there must be a program that listens for such requests and uses Java appropriately to create the correct response. Java is not simply a development kit: It's a programming language. What you download from the website is the development kit + The Runtime Environment.

Upvotes: 0

Aaron Digulla
Aaron Digulla

Reputation: 328564

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.

Upvotes: 1

matt b
matt b

Reputation: 139921

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.

Upvotes: 2

McDowell
McDowell

Reputation: 108879

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

Upvotes: 3

Related Questions