Differences Between JDK, JRE and JVM - GeeksforGeeks

Differences Between JDK, JRE and JVM

Last Updated : 23 Oct, 2026

JDK (Java Development Kit), JRE (Java Runtime Environment), and JVM (Java Virtual Machine) represent different parts of Java development and execution. The JDK provides the tools and runtime components needed to develop and run Java applications, while the JVM is responsible for executing Java bytecode.

  • JDK provides development tools such as javac, java, jar, and javadoc, along with the components required to run Java applications.
  • JRE traditionally refers to the Java runtime environment consisting of the JVM and supporting runtime libraries. In modern Java, it should not always be understood as a separately installed package.
  • JVM loads and executes Java bytecode and provides services such as memory management and garbage collection.
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.
  • Includes the runtime components needed to execute Java applications in addition to development tools.

Key Components of JDK

  • javac: Compiles Java source code (.java) into bytecode (.class).
  • java: Launches Java applications using the JVM.
  • jdb: Helps debug Java applications.
  • jar: Packages Java classes and resources into JAR files.
  • javadoc: Generates documentation from Java source code.

Example: When a developer writes a Java program, the JDK provides the compiler to convert the source code into bytecode and the runtime tools to execute it.

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.

Key Components of JRE:

  • JVM: Executes Java bytecode.
  • Core Libraries: Provide built-in classes for strings, collections, input/output, and other operations.
  • Supporting Runtime Files: Provide resources and components required to run Java applications.

Example: A user running an already compiled Java application needs an appropriate Java runtime, but does not need the Java compiler.

Note: Starting with Java 9, the Java platform introduced modular runtime images. Since Java 11, Oracle no longer distributes a separate traditional JRE alongside its JDK. Modern Java applications can use a full JDK or a custom runtime image created using jlink.

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:

  • Class Loading: Loads required Java classes into memory.
  • Bytecode Verification: Checks bytecode for structural and type-safety requirements.
  • Execution: Interprets bytecode or compiles frequently executed code into native instructions using the Just-In-Time (JIT) compiler.
  • Memory Management: Manages runtime memory and performs garbage collection.
  • Exception Handling: Supports exception handling during program execution.

Example: The same compiled Java bytecode can execute on Windows, Linux, and macOS using a compatible JVM for each platform.

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