
- Java Virtual Machine (JVM) – the engine that interprets and executes Java bytecode
- Core Java class libraries – essential APIs like java.lang, java.util, etc.
- Supporting configuration files and runtime libraries
- Loading class files
- Verifying bytecode for security
- Interpreting or compiling bytecode to native machine code (via JIT compilation)
- Managing memory via garbage collection
- Handling exceptions and thread management
- javac – the Java compiler
- java – the launcher/interpreter for Java applications
- jar – the archiver for packaging Java classes
- javadoc – the tool for generating API documentation
- several debugging and monitoring utilities
- Java Standard Edition (SE) – for general-purpose applications
- Java Enterprise Edition (EE) – for large-scale, distributed, and web-based applications
- Java Micro Edition (ME) – for mobile and embedded systems
How JDK, JRE, and JVM Work Together
Here's how they interact:
-
You write Java code using the tools provided by the JDK—typically in
.java
source files. -
The JDK’s compiler (
javac
) compiles this source code into bytecode (.class
files), which is a platform-independent intermediate representation. -
To run the application, the JRE steps in. It provides the runtime environment—including all necessary class libraries and configuration files—to execute the bytecode.
-
The JVM, which is part of the JRE, loads and interprets (or JIT compiles) the bytecode into native machine code for the host operating system.
-
During execution, the JVM handles memory management, garbage collection, security checks, and thread management, ensuring safe and efficient program execution.
In summary:
-
The JDK is for developing Java applications.
-
The JRE is for running Java applications.
-
The JVM is the engine that executes the bytecode on the host machine.

Comparison Table
Feature | JDK ( Java Development Kit ) | JRE ( Java Runtime Environment ) | JVM ( Java Virtual Machine ) |
---|---|---|---|
Definition
|
Full toolkit for Java development; includes everything in JRE plus development tools
|
Environment to run Java applications; includes JVM and libraries
|
Abstract machine that executes Java bytecode
|
Primary Purpose
|
Develop, compile, debug, and run Java applications
|
Run Java applications
|
Execute Java bytecode
|
Includes
|
JRE, compiler (javac), debugger, JavaDoc, JShell, other dev tools
|
JVM, core libraries, supporting files
|
Only the runtime environment for executing bytecode
|
Development Tools
|
Yes (compiler, debugger, etc.)
|
No
|
No
|
Execution Tools
|
Yes (can both compile and run code)
|
Yes (can run code only)
|
Yes (executes bytecode)
|
Platform Dependency
|
Platform dependent (different JDK for Windows, Mac, Linux)
|
Platform dependent (different JRE for each OS)
|
Platform independent (specification; implementations are OS-specific)
|
Can Compile Code?
|
Yes
|
No
|
No
|
Can Run Code?
|
Yes
|
Yes
|
Yes (executes bytecode, but needs to be invoked via JRE/JDK)
|
Example Use Case
|
Building and testing a new Java application
|
Running a Java-based desktop application
|
Running any Java application on any OS
|
- JDK: The kitchen, with all the utensils and ingredients to cook a meal (write and build Java apps).
- JRE: The dining table, set and ready to serve the meal (run Java apps).
- JVM: The chef, who takes the recipe (bytecode) and cooks it perfectly, no matter the kitchen (platform)
java -version
javac -version