The Wayback Machine - https://web.archive.org/web/20250306120625/https://www.geeksforgeeks.org/differences-jdk-jre-jvm/
Open In App

Differences between JDK, JRE and JVM

Last Updated : 21 Jan, 2025
Summarize
Comments
Improve
Suggest changes
Like Article
Like
Share
Report
News Follow

Understanding the difference between JDK, JRE, and JVM plays a very important role in understanding how Java works and how each component contributes to the development and execution of Java applications. The main difference between JDK, JRE, and JVM is:

  • JDK: Java Development Kit is a software development environment used for developing Java applications and applets.
  • JRE: JRE stands for Java Runtime Environment and it provides an environment to run only the Java program onto the system.
  • JVM: JVM stands for Java Virtual Machine and is responsible for executing the Java program.

JDK vs JRE vs JVM

Aspect

JDK

JRE

JVM

Purpose

Used to develop Java applications

Used to run Java applications

Responsible for running Java code

Platform Dependency

Platform-dependent

Platform-dependent

Platform-Independent

Includes

It includes development tools like (compiler) + JRE

It includes libraries to run Java application + JVM

It runs the java byte code and make java application to work on any platform.

Use Case

Writing and compiling Java code

Running a Java application on a system

Convert bytecode into native machine code

Note: The JVM is platform-independent, but JVM implements differently in each platform because it interacts with the native operating system and the hardware. So it is in practice, platform dependent.

We have discussed the core differences, now let’s take a closer look at each component. let us discuss them in brief first and interrelate them with the image below proposed.

JDK vs JRE vs JVM

JDK(Java Development Kit)

The JDK is a software development kit that provides the environment to develop and execute the java application. It includes two things:

  • Development Tools (to provide an environment to develop your java programs)
  • JRE (to execute your java program)

Working of JDK

The JDK enables the development and execution of Java programs. Consider the following process:

  • Java Source File (e.g., Example.java): You write the Java program in a source file.
  • Compilation: The source file is compiled by the Java Compiler (part of JDK) into bytecode, which is stored in a .class file (e.g., Example.class).
  • Execution: The bytecode is executed by the JVM (Java Virtual Machine), which interprets the bytecode and runs the Java program.
JRE_JDK_JVM

Note: From above, media operation computing during the compile time can be interpreted.

The following actions occur at runtime as listed below:

  • Class Loader
  • Byte Code Verifier
  • Interpreter
    • Execute the Byte Code
    • Make appropriate calls to the underlying hardware

JRE((Java Runtime Environment)

The JRE is an installation package that provides an environment to only run(not develop) the Java program (or application) onto your machine. JRE is only used by those who only want to run Java programs that are end-users of your system.

Working of JRE

When you run a Java program, the following steps occur:

  • Class Loader: The JRE’s class loader loads the .class file containing the bytecode into memory.
  • Bytecode Verifier: The bytecode verifier checks the bytecode for security and correctness.
  • Interpreter: The JVM interprets the bytecode and executes the program.
  • Execution: The program executes, making calls to the underlying hardware and system resources as needed.

JVM (Java Virtual Machine)

The JVM is a very important part of both JDK and JRE because it is contained or inbuilt in both. Whatever Java program you run using JRE or JDK goes into JVM and JVM is responsible for executing the java program line by line, hence it is also known as an interpreter.

Working of JVM

It is mainly responsible for three activities. 

  • Loading
  • Linking
  • Initialization


Kickstart your Java journey with our online course on Java Programming, covering everything from basics to advanced concepts. Complete real-world coding challenges and gain hands-on experience. Join the Three 90 Challenge—finish 90% in 90 days for a 90% refund. Start mastering Java today!


Next Article
Practice Tags :

Similar Reads

Difference Between JDK and JRE in Java
JDK and JRE are the core concepts in Java programming and their differences are some of the most popular interview questions. We don't use these concepts while programming but if we want to become a Java developer, we must know about these concepts. JDKJDK stands for Java Development Kit. It is a software development environment used to develop Ja
2 min read
How to install JDK and JRE on Godaddy Server?
GoDaddy VPS is a shared server that provides computational services, databases, storage space, automated weekly backups, 99% uptime, and much more. It’s a cheaper alternative to some other popular cloud-based services such as AWS, GPC, and Azure.Java is a high-level, class-based, object-oriented programming language created by James Gosling in 1995
2 min read
Migration to Open JDK from Oracle JDK
Let us first discuss the need for migration. It is as follows as in the year 2018, Oracle announced that after January 2019, businesses will need to purchase a commercial license (i.e., from Oracle) in order to receive software updates. Keep Oracle Java and upgrade to supported patch level and pay the subscription costs. To give you an idea of the
5 min read
How JVM Works - JVM Architecture
JVM(Java Virtual Machine) runs Java applications as a run-time engine. JVM is the one that calls the main method present in a Java code. JVM is a part of JRE(Java Runtime Environment).Java applications are called WORA (Write Once Run Anywhere). This means a programmer can develop Java code on one system and expect it to run on any other Java-enable
7 min read
JRE in Java
Java Runtime Environment (JRE) is an open-access software distribution that has a Java class library, specific tools, and a separate JVM. In Java, JRE is one of the interrelated components in the Java Development Kit (JDK). It is the most common environment available on devices for running Java programs. Java source code is compiled and converted t
4 min read
JRE Full Form
JRE stands for JAVA RUNTIME ENVIRONMENT. JRE is a Subset of JDK. JRE is an Important Component of the Java Environment that Provides an Environment to execute the Java Program. JRE Actually exists as an Implementation of JVM. JRE is set libraries and other files that JVM uses at runtime. JVM performs that made by JRE. Characteristics of JREClassLo
3 min read
Difference between BlueJ and JDK 1.3
Java has been one of the most popular programming languages for many years. Java is Object Oriented. However, it is not considered as a pure object-oriented as it provides support for primitive data types (like int, char, etc). In this article, the difference between BlueJ, a Java IDE and JDK is discussed. BlueJ: BlueJ is a free Java environment st
3 min read
Download and Install Java Development Kit (JDK) on Windows, Mac, and Linux
Java Development Kit (JDK) is one of the most essential tool for developers to build, compile, and run Java applications. Whether you're a beginner or an experienced programmers, installing JDK is the first step towards working with the Java development. You can download JDK to create Android application source file as well using the Java or Kotlin
6 min read
Why Thread.stop(), Thread.suspend(), and Thread.resume() Methods are Deprecated After JDK 1.1 Version?
The Thread class contains constructors and methods for creating and operating on threads. Thread is a subclass of Object that implements the Runnable interface. There are many methods in Thread Class but some of them are deprecated as of JDK 1.1. In this article, we will understand the reason behind it. Deprecated methods are those that are no long
5 min read
JDK in Java
The Java Development Kit (JDK) is a cross-platformed software development environment that offers a collection of tools and libraries necessary for developing Java-based software applications and applets. It is a core package used in Java, along with the JVM (Java Virtual Machine) and the JRE (Java Runtime Environment). Beginners often get confused
5 min read