JDK, JRE and JVM is very common words when developers talk about java applications and their development environments. Let’s find out the differeneces between these words.
JDK vs JRE vs JVM
Java Virtual machine (JVM) is the virtual machine that runs the Java bytecodes. You get this bytecode by compiling the
.java files into
.class files contain the bytecodes understood by the JVM.
The Java Runtime Environment (JRE) provides the libraries (jars), the Java Virtual Machine, and other components to run applications written in the Java. The JRE does not contain tools and utilities such as compilers or debuggers for developing applets and applications.
JDK is a superset of JRE, it contains everything that JRE has along with development tools such as compiler, debugger etc.
Relationship between JDK, JRE and JVM
Based on above details, we can draw a relationship between these three as below –
JRE = JVM + libraries to run Java application.
JDK = JRE + tools to develop Java Application.
In short, if you are a Java application developer who writes code, you will need JDK installed in your machine. But, if you only want to run applications built in Java, you only need JRE installed into your machine.
Happy Learning !!