Difference between JVM, JRE, and JDK

Sriyank Siddhartha
Smartherd
Published in
3 min readMay 14, 2022

--

Often developers get confused between JVM, JRE and JDK. Let’s understand them and what are they used for in Java?

Don’t like reading? Consume this article as video 👇 OR click here to watch

Uploaded on my Youtube Channel Smartherd

The following image shows:

  1. JRE is a combination of JVM and a set of libraries.
  2. JDK is a combination of JRE and development tools.

Feeling confused? Let’s break it down and understand them individually.

JVM (Java Virtual Machine)

It just provides a virtual environment where the Java code will be executed using the JRE.

  • It is virtually present in a device. i.e. it has no physical presence on your device. It just provides a virtual environment for code execution. This means JVM does not execute any code, it just provides a suitable environment.
  • JVM is platform dependent. For each software and hardware, we have a different JVM configuration that would work only for that particular device.

JRE (Java Runtime Environment)

It runs Java code in the virtual environment provided by JVM.

JVM + Library Set = JRE

JRE = JVM + Library Set

JRE is a combination of JVM and a few libraries set. The library set is used by JRE to execute Java code in the virtual environment provided by JVM. So JRE with the help of JVM executes code on your device.

  • It is the implementation of JVM.
  • To run any Java code JRE is required at a minimum.
  • JRE contains a set of libraries that JVM uses at runtime.
  • JRE physically exists, unlike JVM which has no physical existence.
  • JRE is platform-dependent just like JVM.

JDK (Java Development Kit)

It’s a complete kit to develop java apps (write java code) and run them.

JRE + Development Tools = JDK

JDK = JRE + Development Tools

In JDK, the development tools contain the debugger, compiler, executor, and JavaDoc.

That’s it. Thanks!

Here, is the pictorial summary.

Summary

Hope that helps!

One clap, two claps, three claps…. Forty!

If you want video tutorials, subscribe to my youtube channel Smartherd. 100 thousand already did. Don’t wait!

--

--

Sriyank Siddhartha
Smartherd

Tech enthusiast, love coding, and love to make videos on my YouTube channel Smartherd.