What is differences between JDK, JVM and JRE ?

  • 4.4/5
  • 5344
  • Jul 20, 2024

What is JDK?

Java development kit (JDK) is a cross-platformed software development environment that provides the required tools for developing, testing, and running software applications written in the Java programming language.

It consists of the Java Runtime Environment (JRE), an interpreter/loader (Java), a compiler (javac), an archiver (jar), a document generator (Javadoc), and other tools.

In general, the JDK is an implementation of one of the three Java Platforms, i.e., Standard Edition (Java SE), Java Enterprise Edition (Java EE) and Micro Edition (Java ME).

Some of the most popular JDKs are - Oracle JDK, OpenJDK, Azul Systems Zing, IBM J9 JDK and Amazon Corretto.

What is JRE?

The Java Runtime Environment (JRE), is a software layer that runs on top of a computer's operating system and provides the resources that a specific Java program needs to run.

The JRE is one of the interrelated components in the Java Development Kit (JDK) and consists of libraries, tools, a separate JVM, and other resources.

Java source code is compiled and converted to Java bytecode.

In order to run this bytecode on any platform, the appropriate JRE should be installed on that platform (OS).

In general, a JRE includes components like - JDBC, JNDI, Interface Definition Language (IDL), RMI, Scripting and other integration libraries.

What is JVM?

The Java Virtual Machine (JVM) is a engine that provides a runtime environment to drive Java code or applications.

It is a part of the JRE and is the one that actually calls the main method present in a Java program.

It converts Java bytecode into machine language.

A program (code) can be developed on one system and run on any other Java enabled system without any adjustment. This is possible because of the JVM(Java Virtual Machine).

The ClassLoader performs three major functions - Loading, Linking, and Initialization. It reads the ".class" file, generate the corresponding binary data and save it in the method area.

The method area is memory where the class is loaded and, along with that, static variables and constants are defined.

Stack is the memory area where a method is loaded and its execution takes place. All local variables are also stored here.

The heap is the memory where objects and their related instance variables are created. This memory is common and is shared across multiple threads.

The PC register stores the address of the JVM instruction that is currently executing. In Java, each thread has its own PC register.

The JIT compiler compiles the bytecodes into native code for the platform on which it is running.

Index
Modern Java - What’s new in Java 9 to Java 17

32 min

What is differences between JDK, JVM and JRE ?

2 min

What is ClassLoader in Java ?

2 min

Object Oriented Programming (OOPs) Concept

17 min

Concurrency in Java: Creating and Starting a Thread

12 min

Concurrency in Java: Interrupting and Joining Threads

5 min

Concurrency in Java: Race condition, critical section, and atomic operations

13 min

Concurrency in Java: Reentrant, Read/Write and Stamped Locks

11 min

Concurrency in Java: "synchronized" and "volatile" keywords

10 min

Concurrency in Java: using wait(), notify() and notifyAll()

6 min

Concurrency in Java: What is "Semaphore" and its use?

2 min

Concurrency in Java: CompletableFuture and its use

18 min

Concurrency in Java: Producer-consumer problem using BlockingQueue

2 min

Concurrency in Java: Producer-Consumer Problem

2 min

Concurrency in Java: Thread pools, ExecutorService & Future

14 min

Java 8 Lambdas, Functional Interface & "static" and "default" methods

28 min

Method Reference in Java (Instance, Static, and Constructor Reference)

9 min

What’s new in Java 21: A Tour of its Most Exciting Features

14 min

Java Memory Leaks & Heap Dumps (Capturing & Analysis)

9 min

Memory footprint of the JVM (Heap & Non-Heap Memory)

15 min