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?
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.
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.
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.
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.
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
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With