JVM vs JDK vs JRE

Anojaa Gnaneswaran
3 min readMar 1, 2022

--

As a Java developer, Important to understand Basic concept of JVM,JDK and JRE.In this Article You will get the Good idea of JVM ,JDK and JRE.

Java components

It is important to understand about java components.There are three main components in java.

Java components
  1. Java Development kit.(JDK)
  2. Java Runtime Environment.(JRE)
  3. Java Virtual Machine.(JVM)

1. Java virtual machine (JVM)

Virtual Machine

First we must to know what is virtual machine,Its give a good idea to understand “what is JVM?”

I hope you all know what is a virtual ,that mean“the object should not be in real but creating simulate environment for feel real object”. Machine is “used for do our works in easy way”.

There are two types of virtual machine,Lets discuss one by one

  1. System based virtual machine(SVM) :- One or multiple hardware will be Generate multiple environment to work,most important fact is this environment are completely independent.

eg:- xen, Hypervisor

2. Application based virtual machine(AVM) :- This will only Include software application for help to create platform to run programs,doesn’t have any hardware here.Also AVM called as process based virtual machine.

eg:-JVM , CLR (Common Language Runtime:- .net), PVM(Parrot Virtual Machine :- Its create environment for dynamic virtual machine)

JVM is a engine that provide a runtime environment for our Java programs.Its convert byte code into machine code and It is come under Application based virtual machine(AVM). JVM is completely specification. Java Virtual Environment(JRE) contain Java Virtual Machine(JVM). when we Install JRE, JVM come within JRE. It will deployed all the code which can Generate the JVM.

We Install JRE on a window platform,It will deploy code which is required to create the JVM on window platform.like the way It mac and other operating systems.when we start the Java program then JVM instance create on our computer.JVM create non-daemon thread for execution our programs.

Existence of Java Virtual Machine

  • JVM born :- when application started
  • JVM die:- when application ended
  • If you started three different programs in your computer,It create three different Environment on your computer.

JVM will be exit in two ways

  1. If all the non-daemon Threads are exit(Distroyed),Then JVM terminate active daemon threads.
  2. If Application died by itself .

ex:- system.exit() method

2.Java Runtime Environment (JRE)

JRE is the implementation of JVM and contains libraries and other files which are used by JVM. JRE is used by a Java based application to execute java programs.

JRE comprises mainly java binaries and other classes to execute the program alike of JVM it physically exists. Along with Java binaries JRE also Include Different technologies of deployment, UI to collaboration with code executed, some base libraries for different functionalities and language and util based libraries.

3.Java Development Kit (JDK)

JDK is Introduced by java oracle corporation.JDK is set of JRE and development tools like javac and java etc. It used for develop Java programs and Java based applications.

It is platform dependent.There is separate installers for Windows, Mac, and Unix systems.It is entirely responsible for code execution. It is the version of JDK which represent version of Java.

I hope All you got basic Idea about JVM,JRE and JDK.

Happy Coding!

Reference

  1. https://www.tutorialspoint.com/differences-between-jdk-jre-and-jvm

--

--

Anojaa Gnaneswaran

Faculty of IT, University of Moratuwa, Associated Software Engineer at Virtusa