Free tutorials in Hindi & English Daily computer, mobile and IT guides Beginner friendly learning
Blog · Java · 04 Jul 2026 · Hindi + English

Difference Between JDK, JRE and JVM (With Diagram Logic)

JDK = development kit (compiler + JRE), JRE = runtime (libraries + JVM), JVM = the engine that runs bytecode. Full comparison table and interview answers.

The one-line answer

JVM runs the code, JRE provides what's needed to run it, JDK provides what's needed to write and run it. Relationship: JDK ⊃ JRE ⊃ JVM — each one contains the next.

JVM — Java Virtual Machine

The engine that actually executes Java bytecode (.class files). It converts bytecode to machine code for the current operating system. This is why Java is "write once, run anywhere" — the .class file is the same everywhere, only the JVM differs per platform.

MyProgram.java --(javac)--> MyProgram.class --(JVM)--> machine code

JVM also handles memory management and garbage collection.

JRE — Java Runtime Environment

JRE = JVM + core libraries (java.lang, java.util, collections, IO...). If you only want to run a Java application, JRE is enough. It contains no compiler — you cannot write/compile programs with JRE alone.

JDK — Java Development Kit

JDK = JRE + development tools: javac (compiler), java (launcher), jar, javadoc, debugger. Developers install JDK; end users historically needed only JRE.

JDK  =  JRE  +  javac, jar, javadoc, debugger
JRE  =  JVM  +  core libraries
JVM  =  the bytecode execution engine

Comparison table

PointJDKJREJVM
Full formJava Development KitJava Runtime EnvironmentJava Virtual Machine
PurposeDevelop + runRun onlyExecute bytecode
ContainsJRE + dev toolsJVM + librariesExecution engine
Compiler (javac)✅ Yes❌ No❌ No
Who installsDevelopersEnd usersComes inside JRE
Platform dependent?YesYesYes (but bytecode is not)

Interview follow-up: Is JVM platform independent?

No — this is the trap. The JVM itself is platform dependent (Windows JVM ≠ Linux JVM). It is the bytecode that is platform independent, and the platform-specific JVM is exactly what makes that possible. Say it this way and the interviewer knows you actually understand it.

One-line answer

JVM code चलाता है, JRE चलाने का सामान देता है, JDK लिखने + चलाने का सामान देता है. Relationship: JDK ⊃ JRE ⊃ JVM — हर एक अगले को contain करता है.

JVM — Java Virtual Machine

वह engine जो Java bytecode (.class files) को actually execute करता है. यह bytecode को current operating system के machine code में बदलता है. इसीलिए Java "write once, run anywhere" है — .class file हर जगह same है, सिर्फ JVM हर platform पर अलग है.

MyProgram.java --(javac)--> MyProgram.class --(JVM)--> machine code

JVM memory management और garbage collection भी handle करता है.

JRE — Java Runtime Environment

JRE = JVM + core libraries (java.lang, java.util, collections, IO...). अगर आपको Java application सिर्फ चलानी है, तो JRE काफी है. इसमें compiler नहीं है — अकेले JRE से program लिख/compile नहीं कर सकते.

JDK — Java Development Kit

JDK = JRE + development tools: javac (compiler), java (launcher), jar, javadoc, debugger. Developers JDK install करते हैं; end users को historically सिर्फ JRE चाहिए होता था.

JDK  =  JRE  +  javac, jar, javadoc, debugger
JRE  =  JVM  +  core libraries
JVM  =  bytecode execution engine

Comparison table

PointJDKJREJVM
Full formJava Development KitJava Runtime EnvironmentJava Virtual Machine
PurposeDevelop + runसिर्फ runBytecode execute
ContainsJRE + dev toolsJVM + librariesExecution engine
Compiler (javac)✅ हां❌ नहीं❌ नहीं
कौन install करता हैDevelopersEnd usersJRE के अंदर आता है
Platform dependent?हांहांहां (लेकिन bytecode नहीं)

Interview follow-up: क्या JVM platform independent है?

नहीं — यही trap है. JVM खुद platform dependent है (Windows JVM ≠ Linux JVM). Platform independent bytecode है, और platform-specific JVM ही उसे possible बनाता है. ऐसे बोलेंगे तो interviewer समझ जाएगा कि आपको सच में concept आता है.

Frequently Asked Questions

What is the difference between JDK, JRE and JVM in one line?

JVM executes bytecode, JRE = JVM + libraries needed to run programs, and JDK = JRE + compiler and tools needed to develop programs.

Is JVM platform independent?

No. The JVM is platform dependent; it is the bytecode that is platform independent, and each platform has its own JVM to run the same bytecode.

Can we run a Java program with only JRE?

Yes, an already-compiled .class or .jar file runs with JRE alone, but compiling .java source files requires the JDK because javac is only in the JDK.