JVM / JRE / JDK
These three terms describe different layers of the Java platform:
JVM (Java Virtual Machine)
The JVM is the runtime engine that executes Java bytecode.
- Loads classes, verifies bytecode for safety, and runs code
- Provides Garbage Collection (GC) for automatic memory management
- Uses JIT compilation to convert hot bytecode into optimized native machine code
JRE (Java Runtime Environment)
The JRE is what you need to run a Java program.
- Includes the JVM + core Java libraries
- Does not include development tools like the compiler
JDK (Java Development Kit)
The JDK is what you need to build Java applications.
- Includes the JRE + developer tools
- Common tools:
javac(compiler)java(launcher)javadoc(documentation generator)jshell(interactive shell)
Simple rule:
- If you only want to run apps → JRE (practically today, most people just install a JDK)
- If you want to develop apps → JDK