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.

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
| Aspect | JDK | JRE | JVM |
|---|---|---|---|
| Full Form | Java Development Kit | Java Runtime Environment | Java Virtual Machine |
| Purpose | Develop and run Java applications | Provide the runtime environment | Execute Java bytecode |
| Main Users | Developers | Application users/runtime environments | Runtime engine |
| Contains | Development tools + runtime components | JVM + runtime libraries | Execution engine and runtime subsystems |
| Compiler | Includes javac | Does not provide the compiler | Does not compile .java source code |
| Runs Java programs | Yes | Yes, conceptually | Yes |
| Platform | JDK builds are platform-specific | Runtime implementation is platform-specific | JVM implementation is platform-specific |
| Bytecode | Produces bytecode using javac | Provides environment to run bytecode | Executes bytecode |
| Memory Management | Through its JVM/runtime | Through its JVM | Directly manages runtime memory |
| Garbage Collection | Through its JVM | Through its JVM | Performs garbage collection |