Unit 1 · Starting From Zero · 7 min
JDK, JRE and JVM
The JDK is the toolkit used to develop Java applications and includes development tools plus the runtime components needed to run them. The JVM is the engine that executes Java bytecode.
Why this matters
Exam questions ask this almost every year, and understanding it explains why Java code becomes a .class file before it runs.
Real-life analogy
Think of the JVM as the engine that runs bytecode. The JDK is the complete workshop: it includes that runtime engine, supporting libraries and tools such as the compiler.
Example
Java
Hello.java --(javac compiler)--> Hello.class (bytecode) --(JVM)--> OutputStep by step
- 1You write source code in a file ending with .java.
- 2The compiler `javac` converts it into bytecode, a .class file.
- 3Bytecode is not machine code — it is understood by the JVM.
- 4A compatible JVM can run that bytecode on different operating systems. This is what makes Java applications portable.
Key points
- JDK = the development kit, including tools such as javac and the runtime components needed to run Java applications
- JVM = the runtime engine that loads and executes Java bytecode
- JRE is the traditional name for a runtime-only bundle; modern Java users commonly install a JDK or use an application-specific runtime instead of downloading a separate JRE
- javac compiles, java runs
Common mistakes
- Saying the JVM compiles code — it executes bytecode
- Assuming a separate JRE download is required for every modern Java setup
Try it yourself
- Draw the flow from .java file to output.
- Explain to a friend why the same .class file works on Windows and Linux.