Skip to content

What is the difference between JDK and JRE?

The Java Development Kit (JDK) is a software development kit that contains the tools and libraries needed to develop Java applications. The JDK includes the Java Runtime Environment (JRE), which is a set of libraries and tools that allow Java applications to run on a computer.

In other words, the JRE is a subset of the JDK that includes the tools and libraries needed to run Java applications, while the JDK includes the JRE as well as additional tools and libraries for developing Java applications.

Here are some key differences between the JDK and the JRE:

  • The JDK includes the JRE: As mentioned, the JRE is included in the JDK, so you don't need to install the JRE separately if you have the JDK installed.
  • The JDK includes tools for developing Java applications: The JDK provides tools for compiling and packaging code, such as the javac compiler and the jar tool. Note that the java launcher is actually part of the JRE, but it is bundled with the JDK for convenience.
  • The JDK includes development-specific modules: Starting with Java 9, the Java Platform Module System (JPMS) changed how components are packaged. The JDK contains all JRE modules plus additional development tools and modules (like jlink and javadoc) that are not required for running applications.

In general, you will need to install the JDK if you want to develop Java applications, while the JRE is sufficient if you just want to run Java applications. Modern Java also allows you to create custom, optimized JREs using the jlink tool included in the JDK.

I hope this helps! Let me know if you have any questions.

Dual-run preview — compare with live Symfony routes.