Difference between: JDK vs JRE vs JVM

You will discover the distinctions between JDK, JRE, and JVM in this course.

JDK (Java Development Kit)

JDK is a superset of JRE; it includes all the features of JRE as well as development tools including a compiler and debugger.

  1. JDK, or Java Development Kit, stands for. You must first install JDK on your machine before you can install Java on it.
  2. The tools you need to create and run Java programs are included in JDK.
  3. Private JRE, JVM, compiler, Java application launcher, Appletviewer, and other components make up JDK. Additionally, it offers the Java API Standard Edition (SE).

Features of JDK

  1. The JDK has a full Java Runtime Environment (JRE) that is separate from the standard JRE, which is why it is sometimes referred to as a private runtime even though it has all the capabilities of JRE.
  2. It includes every Java development tool, including the compiler, JVM, JRE, debugger, and others.
  3. JDK is required in order to create and execute Java programs.
  4. JDK may be installed on Windows, Mac, and other operating systems and supports a variety of platforms.

JRE (Java Runtime Environment)

The environment in which the Java virtual machine operates is known as RE. JRE comes with the Java Virtual Machine (JVM), class libraries, and other files but not with the compiler or debugger that are used for development.
This implies that while JRE may be used to run code, it cannot be used to create or compile code.

  1. The Java Runtime Environment is known as JRE. It gives Java programs a runtime environment.
  2. To run Java apps, you require JRE. JDK is not required if you are not a developer and are not developing Java applications, however JRE is required to run Java apps.
  3. You do not need to download and install JRE individually because it is currently included with all JDK packages.
  4. The libraries and other items that JRE includes are used by JVM during runtime.

Features of JRE

  1. JRE includes a collection of libraries and other tools that JVM requires during runtime.
  2. Any Java application can be executed with ease using JRE, but you need the JDK to create and compile Java programs.
  3. JRE includes libraries needed for integrations, including those for Remote Method Invocation (RMI), Java Naming and Directory Interface (JNDI), and Java Database Connectivity (JDBC).

JVM (Java Virtual Machine)

A high level programming language is Java. High level programming languages cannot be directly executed on any computer. It must first be converted into that specific machine language. The javac compiler performs this; it converts the source code from a java program ( file) into machine code (referred as byte code or .class file).

The machine language for the Java Virtual Machine (JVM), a virtual machine that lives in the actual machine (your computer), is byte code. As a result, the compiler’s job is made simpler because it just needs to produce JVM-specific bytes rather than distinct machine code for each type of machine. JVM produces output by running the bytes of code produced by the compiler. Java is made platform agnostic via the JVM.

Features of JVM

Java is fully platform neutral thanks to the JVM, which enables execution of Java code on any computer.
Java programs may also be executed on cloud computing systems.
JVM is present in both JDK and JRE.

In that it runs the Java code line by line, JVM functions as an interpreter.
The bytecode is transformed into machine code by JVM. JVM is platform neutral since it is not reliant on the computer’s operating system or hardware.

Difference between JDK, JRE and JVM

JDK stands for Java Development Kit JRE stands for Java Runtime Environment JVM stands for Java Virtual Machine.
It contains everything that JRE has along with development tools such as compiler, debugger etc. JRE contains Java virtual Machine(JVM), class libraries, and other files excluding development tools such as compiler and debugger. Java Virtual Machine (JVM) is a virtual machine that resides in the real machine (your computer) and the machine language for JVM is byte code
JDK is a superset of JRE It is a subset of JDK. JVM is a subset of JRE.
JDK is used to create and compile Java programs. JRE is a part of JDK that contains JVM. JVM is used to run the java code on any machine.


Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top button