7

I've noticed that within the C:\Program Files\Java folder, there's the public JRE which the JDK installed, I know this is normal. But then there's the folder jdk1.x\jre\bin\ with java.exe, javaw etc in it. And then there's the compiler folder jdk1.x\bin which contains javac along with all the other files included in the JRE like java.exe, javaw, appletviewer etc.

Why does JDK come with all these JREs? What's the difference between these 3?

Roman C
  • 49,761
  • 33
  • 66
  • 176
Alex
  • 3,111
  • 6
  • 27
  • 43

2 Answers2

3

Sun/Oracle documents the JDK directory organization here:

c:\jdk1.6.0\jre\bin: Executable files and DLLs for tools and libraries used by the Java platform. The executable files are identical to files in /jdk1.6.0/bin.

...

Note that the file structure of the JRE is identical to that of the JDK's jre directory.

Basically, the JRE directory contains the files you can redistribute with your application, should you choose to

paulsm4
  • 114,292
  • 17
  • 138
  • 190
  • Be careful to check the paper work about re-distribution of the jre. Last time I checked sun did not let you do this, but that was before oracle took over. – Tinman Nov 14 '12 at 04:10
2

I don't have any inside knowledge, however I have found this to be useful on occasion.

Generally the JDK is not installed on peoples workstations, only the JRE. I like to run my applications under the JRE that I know will be the same as that installed to clients.

Tinman
  • 786
  • 6
  • 18