Difference between JDK, JRE and JVM

Understand the Difference Between JDK JRE and JVM

The three components of Java are JDK, JRE, and JVM. In this post, we will learn the difference between JDK JRE and JVM in detail.

Difference between JDK JRE and JVM

The following image illustrate all the detail that will be easier to remember.

Difference Between JDK, JRE, and JVM
Understand the Difference Between JDK JRE and JVM 3

JDK

JDK stands for Java Development Kit. It consists of all the tools that are needed to develop Java applications. JDK is platform dependent. Hence, we need to download it for each platform. There are different JDK available for different operating systems. JDK physically exists and contains JRE and JVM.

JRE

JRE stands for Java Runtime Environment. It is used to provide a runtime environment for Java applications. It is the implementation of JVM and it also physically exists like JDK. It is also platform dependent. We can find different implementations of JVM besides Oracle. For example Amazon Corretto.

JVM

JVM stands for Java Virtual Machine. It does not exist physically like JDK and JRE. It plays a important role to make Java very popular and platform independent. JVM is platform dependent like JDK and JRE because the configuration of each operating system is identical.

But Java is platform independent.

JVM mainly does the following things:

  • To load class
  • To verify code
  • To execute code and
  • To provide runtime environment

Conclusion

In this short post, we understood the main difference between JDK JRE and JVM in detail.