What is jre and jdk
Last updated: April 1, 2026
Key Facts
- JRE contains the Java Virtual Machine (JVM) which is necessary to execute Java applications
- JDK includes the JRE plus additional development tools such as the Java compiler (javac) and debugging utilities
- Developers need JDK installed to write and compile Java source code, while end users only need JRE to run applications
- Both JRE and JDK are platform-specific with versions available for Windows, macOS, and Linux
- Oracle provides official distributions of both JRE and JDK, with long-term support versions released every three years
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.
| Feature | JRE | JDK |
|---|---|---|
| Java Virtual Machine (JVM) | Yes | Yes |
| Java Class Library | Yes | Yes |
| Java Compiler (javac) | No | Yes |
| Debugger and Development Tools | No | Yes |
| Purpose | Running Java programs | Developing Java programs |
| Typical Size | 100-200 MB | 300-500 MB |
| Who Needs It | End users | Developers |
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.
More What Is in Daily Life
Also in Daily Life
More "What Is" Questions
Trending on WhatAnswers
Browse by Topic
Browse by Question Type
Sources
- Wikipedia - Java (programming language)CC-BY-SA-4.0
- Oracle Java DownloadsAll Rights Reserved
- Oracle Java SE DocumentationAll Rights Reserved