Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why does each JDK come with 3 JREs?

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?

like image 268
Alex Avatar asked Nov 13 '12 04:11

Alex


People also ask

What is the difference between Java and Java JDK?

JDK(Java Development Kit) is used to develop Java applications. JDK also contains numerous development tools like compilers, debuggers, etc. JRE(Java Runtime Environment) is the implementation of JVM(Java Virtual Machine) and it is specially designed to execute Java programs.

Do I need both Java JDK and JRE?

The JDK includes the JRE, so you do not have to download both separately. To understand the version-string scheme that is used to distinguish various JDK and JRE releases, see Version-String Format.

What is difference between JDK JRE and JVM in Java?

JDK is primarily used for code execution and has prime functionality of development. On other hand JRE is majorly responsible for creating environment for code execution. JVM on other hand specifies all the implementations and responsible to provide these implementations to JRE.

Which Java JDK should I download?

Java SE 11 OR 17 remains the preferred production standard in 2022. While both 9 and 10 have been released, neither will be offering LTS. Since it's first release in 1996, Java has maintained a reputation for being one of the most secure, reliable, and platform independent languages for computer programming.


2 Answers

Sun/Oracle documents the JDK directory organization here:

  • http://docs.oracle.com/javase/6/docs/technotes/tools/windows/jdkfiles.html

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

like image 164
paulsm4 Avatar answered Oct 21 '22 01:10

paulsm4


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.

like image 2
Tinman Avatar answered Oct 21 '22 03:10

Tinman