Difference between JDK, JRE and JVM

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

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

Summary

The summary of difference between JDK JRE and JVM in tabular form is given below:

JDK (Java Development Kit)JRE (Java Runtime Environment)JVM (Java Virtual Machine)
DefinitionA software development kit that includes tools for developing Java applications.A runtime environment that allows the execution of Java programs.A virtual machine that executes Java bytecode.
ComponentsIncludes the JRE, compiler (javac), debugger, and other development tools.Includes libraries, JVM, and other components necessary to run Java applications.Interprets Java bytecode and provides an execution environment for Java programs.
UsageUsed for developing, compiling, and debugging Java applications.Used for running Java applications without development capabilities.Used for executing Java bytecode on various platforms.
DependencyRequires JRE for running Java applications.Doesn’t require any additional components.Doesn’t require any additional components.
ExampleOracle JDK, OpenJDKOracle JRE, OpenJREHotSpot JVM, OpenJ9 JVM