JVM, JDK & JRE
Three letters that confuse every beginner. Let's clear them up in 5 minutes.
The big picture
When you "install Java", you're really installing a platform — a stack of three nested components. From outermost to innermost:
- JDK — Java Development Kit (for writing code)
- JRE — Java Runtime Environment (for running code)
- JVM — Java Virtual Machine (the engine that actually executes)
The JDK contains the JRE, and the JRE contains the JVM. Like Russian nesting dolls.
JVM — Java Virtual Machine
The JVM is the actual engine that runs Java code. When you compile Java source (.java) you don't get a native executable — you get bytecode (.class files). The JVM reads bytecode and executes it on whatever operating system it's running on.
This is the magic of "write once, run anywhere": the same bytecode runs on Windows, macOS, Linux, Android — because each platform has its own JVM that knows how to translate bytecode into native instructions.
JRE — Java Runtime Environment
The JRE is the JVM plus the standard libraries (the java.* packages). It's what you need to run Java applications, but not to write them.
If you're just running a banking app or a Minecraft server written in Java, the JRE is enough.
JDK — Java Development Kit
The JDK is the JRE plus developer tools — the compiler (javac), debugger (jdb), packaging tools, documentation generator, and more. If you're learning Java or writing code, you want the JDK.
Compilation flow
Hello.java ← your source code │ │ javac (compiler — part of JDK) ▼ Hello.class ← bytecode (platform-independent) │ │ java (launcher — runs the JVM) ▼ JVM executes │ ▼ Native machine instructions ← JIT-compiled at runtime
Which one do you need?
- Just running a Java app? JRE (or JDK — JDK includes everything).
- Learning, writing, or building Java? JDK. Always JDK.
- Setting up a server to run a Spring Boot service? JDK is the standard choice today (Oracle stopped shipping standalone JREs after Java 11).
Picking a version
Java has Long-Term Support (LTS) releases every 2–3 years. As of 2026, the current LTS versions are Java 21 and Java 17. Both are excellent choices for new projects. Stick to LTS for production work — non-LTS versions stop receiving updates after 6 months.