DEV Community

Cover image for What is the difference between JDK, JRE, and JVM?
Piyush Kumar Singh
Piyush Kumar Singh

Posted on

What is the difference between JDK, JRE, and JVM?

Reference : Java

1. JDK (Java Development Kit)
It is required for developing Java applications.
Contains:
JRE (Java Runtime Environment)
Development tools (compiler javac, debugger jdb, JavaDoc, etc.)
If you want to write, compile, and run Java programs, you need JDK.
Example: If you're a developer writing Java code, you need the JDK to compile and execute your programs.

2. JRE (Java Runtime Environment)
It is used only to run Java applications, not to develop them.
Contains:
JVM (Java Virtual Machine)
Core Java libraries (rt.jar, etc.)
If you just want to run a Java program but not develop it, JRE is enough.
Example: If you download a Java application (like Eclipse or Minecraft), you only need JRE to run it.

3. JVM (Java Virtual Machine)
It is responsible for executing Java bytecode.
JVM is platform-dependent (Windows, Linux, macOS) but the bytecode is platform-independent.
Performs Just-In-Time (JIT) compilation, optimizing performance.
Handles Garbage Collection, memory management, and security features.
Example: When you run a Java program, JVM converts the .class file (bytecode) into machine code for execution.

Other References :

Java8 : Link
Advance Java : Link
Core Java : Link
Java OOP's : Link
Spring Boot : Link
Advanced Spring Boot : Link
Linux : Link
ReactJS : Link
API : Link
OS : Link
NodeJS : Link
Python : Link
HTML : Link

PrepStat | Placement Preparation

Sentry image

Hands-on debugging session: instrument, monitor, and fix

Join Lazar for a hands-on session where you’ll build it, break it, debug it, and fix it. You’ll set up Sentry, track errors, use Session Replay and Tracing, and leverage some good ol’ AI to find and fix issues fast.

RSVP here →

Top comments (0)