DEV Community

Hayes vincent
Hayes vincent

Posted on

what is JDK,JRE,JVM,JIT?

JDK (Java Development Kit)

Used by: Developers

What it is:
JDK is a complete package to develop Java applications.

It includes:

JRE

Compiler (javac)

Debugger

Other development tools

Example:
If you want to write and compile Java code, you need JDK.

👉 Without JDK, you cannot develop Java programs.

2️⃣ JRE (Java Runtime Environment)

Used by: To run Java programs ▶️

What it is:
JRE provides the environment to execute Java applications.

It includes:

JVM

Core Java libraries

Supporting files

Example:
If you only want to run a Java app, JRE is enough.

JRE cannot compile code.

3️ JVM (Java Virtual Machine)

What it is:
JVM is a virtual machine that runs Java bytecode.

Main roles of JVM:

Converts bytecode into machine code

Memory management

Garbage collection

Platform independence

Why Java is platform-independent?
Because JVM is different for each OS, but bytecode is same everywhere.

Write once, run anywhere

4️JIT (Just-In-Time Compiler)

What it is:
JIT is a part of JVM that improves performance 🚀

How it works:

Converts bytecode → native machine code at runtime

Compiles frequently used code only

Benefit:

Faster execution

Better performance than normal interpretation

Top comments (0)