Java Interview Question

What is the difference between JDK, JRE, and JVM?

Updated 2026-07-10 · Beginner friendly
Quick answer

The JVM is the engine that runs Java bytecode. The JRE is the JVM plus the core libraries needed to run Java programs. The JDK is the JRE plus the tools needed to develop Java programs, such as the compiler. In short, JDK is for building and running, JRE is for running only, and JVM is the part that actually executes the code.

Think of it as layers

The relationship nests neatly. The JDK contains the JRE, and the JRE contains the JVM. If you only want to run a Java app you need the JRE. If you want to write and compile one you need the JDK.

In the interview

Interviewers like the one line summary: JDK to develop, JRE to run, JVM to execute. Adding that the JDK contains the JRE which contains the JVM shows you understand how they fit together.

Want the full Java guide?

Read every Java concept with notes, diagrams, and code in one place. Track your progress as you go.

Open the Java guide All Java questions