What is jre and jdk

Last updated: April 1, 2026

Quick Answer: JRE (Java Runtime Environment) is the platform for running Java programs, while JDK (Java Development Kit) is the complete package for development including tools to write, compile, and debug Java code.

Key Facts

Understanding JRE and JDK

JRE (Java Runtime Environment) and JDK (Java Development Kit) are two essential components of the Java ecosystem, but they serve different purposes. The JRE is what runs Java programs on your computer, while the JDK is what you use to create those programs. Understanding the difference between these two is crucial for anyone working with Java, whether you're a developer creating applications or a user simply running Java programs.

What is the Java Runtime Environment (JRE)?

The JRE is a package that enables your computer to run Java applications. At its core is the Java Virtual Machine (JVM), which interprets and executes compiled Java bytecode. The JRE also includes the Java Class Library, which contains pre-built code for common functionality like file handling, networking, and graphics. If you only want to run Java applications and don't plan to develop them, the JRE is all you need to install on your system. It's lightweight and focused solely on execution, making it ideal for end users.

What is the Java Development Kit (JDK)?

The JDK is a comprehensive package designed for Java developers. It includes everything in the JRE plus essential development tools. The most important tool is the Java compiler (javac), which converts human-readable Java source code (.java files) into compiled bytecode (.class files) that the JVM can execute. The JDK also includes the Java debugger (jdb) for troubleshooting code, the Java documentation generator (javadoc), and other command-line utilities. Developers require the JDK to write, compile, test, and debug Java applications.

Key Components and Differences

The JRE primarily contains the JVM and Java libraries needed for execution. The JDK contains all JRE components plus development tools including the compiler, debugger, and profiler. Think of it this way: the JRE is like a movie player, while the JDK is a complete film production studio. You need the studio (JDK) to create the film (Java application), and viewers only need the player (JRE) to watch it. The JDK is larger in size due to these additional tools, typically around 300-500 MB compared to the JRE's 100-200 MB, depending on the version.

Installation and Platform Support

Both JRE and JDK are available for major operating systems including Windows, macOS, and Linux. Oracle provides official distributions, though other vendors like Adoptium and Amazon Corretto also offer certified versions. Installation is straightforward through installers or package managers. Developers should install the JDK, which includes the JRE, so they have all necessary tools. End users can install just the JRE to save disk space if they only run Java applications. It's important to install the correct version (32-bit or 64-bit) matching your system architecture for optimal performance.

FeatureJREJDK
Java Virtual Machine (JVM)YesYes
Java Class LibraryYesYes
Java Compiler (javac)NoYes
Debugger and Development ToolsNoYes
PurposeRunning Java programsDeveloping Java programs
Typical Size100-200 MB300-500 MB
Who Needs ItEnd usersDevelopers

Related Questions

Can I run Java programs without JDK?

Yes, you only need the JRE to run Java programs. The JDK is only necessary if you want to write and compile Java code. Most end users should install the JRE to save disk space.

Do I need to install both JRE and JDK?

No, since the JDK includes the JRE, you only need to install the JDK if you're developing. The JDK installation includes all JRE components and functionality.

What Java version should I download?

Download the latest LTS (Long Term Support) version for stability, currently Java 21 or Java 17. Check your application requirements, as some software specifies a particular Java version for compatibility.

Sources

  1. Wikipedia - Java (programming language)CC-BY-SA-4.0
  2. Oracle Java DownloadsAll Rights Reserved
  3. Oracle Java SE DocumentationAll Rights Reserved