Differences Between JDK, JRE and JVM

Last Updated : 31 Aug, 2026

JDK (Java Development Kit) provides tools and libraries to develop Java applications, working with JRE and JVM. JRE (Java Runtime Environment) offers the libraries and JVM needed to run Java programs. JVM (Java Virtual Machine) executes the compiled Java bytecode on the system.

  • JDK is mainly used by developers, while JRE is required by end-users to run applications.
  • The JVM executes bytecode, making programs platform-independent across systems.
  • The JDK contains the tools required for development, while the runtime environment contains the components required for execution.
jvm
JDK, JRE and JVM

JDK (Java Development Kit)

The Java Development Kit (JDK) is a software development kit used to develop Java applications. It provides the Java compiler and other tools required to write, compile, test, package, document, and debug Java programs.

  • Includes compiler (javac), debugger, and utilities like jar and javadoc.
  • Provides the JRE, so it also allows running Java programs.

Main Components of JDK

  • Java compiler (javac): Compiles .java source files into .class bytecode files.
  • Java launcher (java): Starts a Java application using the JVM.
  • jar: Creates and manages JAR files.
  • javadoc: Generates documentation from Java source code.
  • Debugging and other development tools: Help developers test and troubleshoot applications.
  • JVM and runtime libraries: Required to run Java applications.

Working of JDK

The basic development process is:

  1. Write source code: The developer creates a .java file.
  2. Compile: javac compiles the source code.
  3. Generate bytecode: The compiler produces .class files containing Java bytecode.
  4. Run: The java launcher starts the JVM, which loads and executes the bytecode.
Java
class Hello {
    public static void main(String[] args) {
        System.out.println("Hello Java");
    }
}

Compile: javac Hello.java

Run:

java Hello

JRE (Java Runtime Environment)

The Java Runtime Environment (JRE) traditionally refers to the components required to run a Java application. It consists primarily of the JVM and the Java runtime libraries.

Main Components of JRE

  • JVM: Executes Java bytecode.
  • Java class libraries: Provide commonly used Java APIs required by applications.
  • Supporting runtime files: Help the JVM and libraries operate.

Working of JRE

When a Java application is started:

  • The JVM is launched.
  • The Class Loader loads the required .class files.
  • The JVM performs linking and initialization.
  • The bytecode is interpreted and/or compiled into native machine code by the JVM.
  • The application executes using the Java runtime libraries.

Important: For current Java versions, avoid describing JRE as a separately installed package for every modern JDK distribution. The concept remains useful for understanding Java's runtime environment, but modern JDK installations are generally used directly.

JVM (Java Virtual Machine)

The Java Virtual Machine (JVM) is the runtime engine that executes Java bytecode. When Java source code is compiled, the compiler generates bytecode in .class files. The JVM loads this bytecode and executes it on the underlying operating system and hardware.

Main Responsibilities of JVM

  • Loads Java classes using the Class Loader.
  • Verifies and links loaded classes.
  • Executes Java bytecode.
  • Uses the JIT compiler to compile frequently executed bytecode into native machine code.
  • Manages runtime memory.
  • Performs garbage collection.
  • Provides runtime security and other execution services.

Working of JVM

The major stages are:

class_loader
JVM working

1. Loading: The Class Loader loads required classes into JVM memory.

2. Linking: Linking consists of:

  • Verification: Checks that the bytecode is structurally and semantically valid.
  • Preparation: Allocates memory for static fields and assigns default values.
  • Resolution: Resolves symbolic references when required.

3. Initialization: The JVM initializes classes and executes their static initialization code.

4. Execution: The JVM executes the bytecode. It may interpret bytecode and use the JIT compiler to compile frequently executed code into native machine code for better performance.

JDK vs JRE vs JVM

AspectJDKJREJVM
Full FormJava Development KitJava Runtime EnvironmentJava Virtual Machine
PurposeDevelop and run Java applicationsProvide the runtime environmentExecute Java bytecode
Main UsersDevelopersApplication users/runtime environmentsRuntime engine
ContainsDevelopment tools + runtime componentsJVM + runtime librariesExecution engine and runtime subsystems
CompilerIncludes javacDoes not provide the compilerDoes not compile .java source code
Runs Java programsYesYes, conceptuallyYes
PlatformJDK builds are platform-specificRuntime implementation is platform-specificJVM implementation is platform-specific
BytecodeProduces bytecode using javacProvides environment to run bytecodeExecutes bytecode
Memory ManagementThrough its JVM/runtimeThrough its JVMDirectly manages runtime memory
Garbage CollectionThrough its JVMThrough its JVMPerforms garbage collection
Comment