What is the difference between JRE ,JDK & JVM ?
JDK,JRE,JVM are most commonly heard and confused terminology
Lets try to understand
JVM stands for Java Virtual Machine
- JVM is responsible for converting byte code into machine specific code .
- There are different JVM for different Operating system.
- All the JVMs understand the byte code given to it no matter from which machine the byte code got created. This makes Java platform independent.
JRE stands for Java Runtime Environment
- Provides the platform to execute/run the java programs.
- Consists of JVM and other libraries which are required to execute the Java program.
- We can run any Java program using JRE but we can’t compile the java code using JRE as it does not contain any compiler, debugger etc..
JDK stands for Java Development Kit which can be downloaded & installed
1.Contains JRE + Development tools like compiler, debugger etc.
2.Since it contains JRE along with compiler, we can write java code and compile the java code.
3.JDK is also platform specific, we need to use separate JDK for different Operating system like Windows, Linux etc
Until Java 8, There was separate downloads for JREs and JDKs – even though the JDK also always included a JRE in a separate folder.
With Java 9 we are always downloading JDK. The directory structure of JDKs also changed, with not having an explicit JRE folder anymore.