Skip to main content

What is JDK?

JDK (Java Development Kit) is a complete toolkit used to develop, compile, and run Java applications.

_ It includes: _

  • JVM (Java Virtual Machine) → Executes Java programs
  • JRE (Java Runtime Environment) → Provides runtime environment
  • Development Tools → Compiler (javac), debugger, etc.

JVM, JRE, JDK

These three terms describe different layers of the Java platform:

JVM (Java Virtual Machine)

The JVM is the runtime engine that executes Java bytecode.

  • Loads classes, verifies bytecode for safety, and runs code
  • Provides Garbage Collection (GC) for automatic memory management
  • Uses JIT compilation to convert hot bytecode into optimized native machine code

Notes

  • Responsible for executing Java bytecode
  • Converts bytecode → machine code
  • Makes Java platform independent

JRE (Java Runtime Environment)

The JRE is what you need to run a Java program.

  • Includes the JVM + core Java libraries
  • Does not include development tools like the compiler

Notes

  • Provides environment to run Java programs
  • Contains:
    • JVM
    • Core libraries (Java API)

JDK (Java Development Kit)

The JDK is what you need to build Java applications.

  • Includes the JRE + developer tools
  • Common tools:
    • javac (compiler)
    • java (launcher)
    • javadoc (documentation generator)
    • jshell (interactive shell)

Simple rule:

  • If you only want to run apps → JRE (practically today, most people just install a JDK)
  • If you want to develop apps → JDK

Notes

  • javac → Compiler
  • java → Runs program
  • jdb → Debugger
  • jar → Package tool

Relationship

👉 JDK = JRE + Development Tools

👉 JRE = JVM + Libraries

Diagrammatic Explanation

Simplified View

Detailed Visualization

What This Diagram Shows

  • JDK tools compile .java → .class
  • JVM process flow:
    • Class loading
    • Verification
    • Memory allocation
  • Execution engine:
    • JIT → converts to native code
    • GC → manages memory
  • Final execution happens on:
    • OS → Hardware

Pro Tip (Important)

  • javac is part of JDK, not inside JVM
  • JVM does not use javac — it only executes bytecode