What are the differences between JDK, JRE, and JVM?
5 minbeginnerjvmjdkjre
Quick Answer
JVM is the abstract machine that executes bytecode. JRE bundles the JVM plus the standard class libraries needed to run applications. JDK bundles the JRE plus development tools (javac, javadoc, jdb, jar) needed to write and compile Java programs.
Detailed Answer
These three terms nest inside each other, from narrowest to broadest:
- JVM (Java Virtual Machine): The abstract runtime engine that loads, verifies, and executes bytecode. It's specification + implementation (HotSpot, OpenJ9, etc.) and includes the class loader, execution engine (interpreter + JIT), and garbage collector.
- JRE (Java Runtime Environment): JVM + the core class libraries (
java.lang,java.util,java.io, ...) needed to run compiled Java applications. Historically shipped separately for end users who only needed to run apps. - JDK (Java Development Kit): JRE (or, since Java 11, the JVM + libraries directly) + development tooling:
javac(compiler),javadoc,jar,jdb(debugger),jshell(REPL), etc. Needed to write and build Java software.
Since Java 11, Oracle stopped shipping a standalone JRE — you install a JDK to both develop and run applications, and can build a minimal custom runtime with jlink if you only need to ship a runtime image.
Rule of thumb: end users running an app need a JRE (or a JDK); developers always need a JDK.