Skip to main content

Understanding JDK, JRE, and JVM

Key Distinction to remember:

Platform Independence vs. Platform Dependence:

  • Java (the language) is platform-independent (Write Once, Run Anywhere).
  • The JVM is platform-dependent. You download a specific JVM for Windows, macOS, or Linux so it can translate that universal bytecode into the specific machine code that the OS understands.

Java Development Kit (JDK)

  • The Java Development Kit (JDK) bundles the Java compiler (javac), standard libraries, debugger and other tools needed to develop, build and package Java applications.
  • A JDK typically contains a runtime implementation, so it includes the components required to run Java programs. However, a JDK is not strictly required on machines that only need to execute Java, only a runtime is necessary.
info

Since Java 11, standalone Java Runtime Environment (JRE) installers are no longer provided, making the JDK the primary distribution for both development and production environments.

Java Runtime Environment (JRE)

  • JRE is required to run Java applications.
  • It includes a JVM implementation, core libraries, and other components to execute Java bytecode on the host machine.
  • It is intended for runtime only, does not include development tools (compiler, debugger).
  • It supports JVM-based languages but is specific to the Java platform.

Java Virtual Machine (JVM)

  • JVM runs any program that's compiled to byte code.
  • It acts like an abstract "virtual" computer.
  • It has byte code loader, verifier and interpreter.
  • It can convert byte code to machine specific code at runtime using Just-In-Time (JIT) compiler.