Difference Between JDK, JRE, and JVM
Difference Between JDK, JRE, and JVM
Download the BYJU'S Exam Prep App for free GATE/ESE preparation videos & tests - Download the BYJU'S Exam
BYJU'S GATE (/gate/) > GATE (/gate/gate-exam/) > Difference Between (/gate/difference-between-in-gate/) > Difference Between JDK, JRE, and JVM
(/gate/difference-between-jdk-jre-and-jvm/)
Out of all the programming languages, Java is the most common one for the purpose of development today. Most developers use it
for mobile and desktop computing, game development, back-end development, etc. Here, JVM, JRE, and JDK play a crucial role in the
development process with Java. Before getting a detailed knowledge of this language, we must know the significant difference
between JDK, JRE, and JVM. In this article, we will discuss the same. But first, let’s get a brief overview of them individually.
What is JDK?
JDK is an abbreviation for Java Development Kit. It is an environment of software development used for developing applets and Java
applications. JDK has a physical existence, and it contains JRE + development tools. One can easily install more than one version of
JDK on the same computer. The Java developers can make use of it on macOS, Windows, Linux, and Solaris. JDK assists them in
coding and running the Java programs.
It is an implementation of any of the given Java Platforms that the Oracle Corporation released:
Micro Edition
Enterprise Edition
Standard Edition
The JDK consists of a private JVM (Java Virtual Machine) along with a few other resources, java (a loader/interpreter), like javac (a
compiler), Javadoc (a documentation generator), jar (an archiver), etc., for completing the process of Java application development.
What is JRE?
JRE stands for Java Runtime Environment- also written as Java RTE. It is a set of software tools designed for running other software. It is
an implementation of JVM, and JRE provides a runtime environment. In short, a user needs JRE to run any Java program. If not a
programmer, the user doesn’t need to install the JDK- JRE alone will help run the Java programs.
All the versions of JDK come bundled up with the JRE (Java Runtime Environment). This way, a user doesn’t have to download and
install JRE on their PC separately. The JRE also exists physically. It consists of a library set + a few more files that the JVM (Java Virtual
Machine) deploys at the runtime.
What is JVM?
JVM stands for Java Virtual Machine. It provides a runtime environment for driving Java applications or code. JVM is an abstract
machine that converts the Java bytecode into a machine language. It is also capable of running the programs written by
programmers in other languages (compiled to the Java bytecode). The JVM is also known as a virtual machine as it does not exist
physically.
JVM is essentially a part of the JRE (Java Run Environment). You cannot separately download and install it. You first need to install the
JRE to install the JVM. It is available for many software and hardware platforms. In various distinct programming languages, the
compiler functions to produce machine code for specific systems. However, only the Java compiler produces code for a virtual
machine- also known as JVM.
Verifies code
Loads code
Executes code
Full- The JDK is an abbreviation for Java The JRE is an abbreviation for Java The JVM is an abbreviation for Java
Form Development Kit. Runtime Environment. Virtual Machine.
Defin The JDK (Java Development Kit) is a The Java Runtime Environment (JRE) is an The Java Virtual Machine (JVM) is a
ition software development kit that implementation of JVM. It is a type of platform-independent abstract
develops applications in Java. Along software package that provides class machine that has three notions in
with JRE, the JDK also consists of libraries of Java, JVM, and various other the form of specifications. This
various development tools (Java components for running the applications document describes the
Debugger, JavaDoc, compilers, etc.) written in Java programming. requirement of JVM implementation.
Func The JDK primarily assists in executing JRE has a major responsibility for creating JVM specifies all of the
tiona codes. It primarily functions in an environment for the execution of code. implementations. It is responsible for
lity development. providing all of these
implementations to the JRE.
Platf The JDK is platform-dependent. It JRE, just like JDK, is also platform- The JVM is platform-independent. It
orm means that for every different dependent. It means that for every means that you won’t require a
Dep platform, you require a different JDK. different platform, you require a different different JVM for every different
ende JRE. platform.
ncy
Tools Since JDK is primarily responsible for JRE, on the other hand, does not consist of JVM does not consist of any tools for
the development, it consists of various any tool- like a debugger, compiler, etc. It software development.
tools for debugging, monitoring, and rather contains various supporting files for
developing java applications. JVM, and the class libraries that help JVM
in running the program.
Impl JDK = Development Tools + JRE (Java JRE = Libraries for running the application JVM = Only the runtime environment
eme Runtime Environment) + JVM (Java Virtual Machine) that helps in executing the Java
ntati bytecode.
on
Why Why use JDK? Why use JRE? Why use JVM?
Use
Some crucial reasons to use JDK are: Some crucial reasons to use JRE are: Some crucial reasons to use JVM are:
It?
It consists of various tools If a user wants to run the Java It provides its users with a
required for writing Java applets, then they must install JRE platform-independent way for
programs. on their system. executing the Java source
JDK also contains JRE for The JRE consists of class libraries code.
executing Java programs. along with JVM and its supporting JVM consists of various tools,
It includes an Appletviewer, Java files. It has no other tools like a libraries, and multiple
The compiler helps in converting JRE uses crucial package classes Just-in-Time (JIT) compiler for
the code written in Java into like util, math, awt, lang, and various converting the Java source
It has all the features that JRE It is a set of tools that actually helps The JVM enables a user to run
does. the JVM to run. applications on their device or
JDK enables a user to handle The JRE also consists of deployment in a cloud environment.
multiple extensions in only one technology. It includes Java Plug-in It helps in converting the
catch block. and Java Web Start as well. bytecode into machine-
It basically provides an A developer can easily run a source specific code.
environment for developing and code in JRE. But it does not allow JVM also provides some basic
executing the Java source code. them to write and compile the Java functions, such as
It has various development tools concerned Java program. garbage collection, security,
like the debugger, compiler, etc. JRE also contains various integration memory management, and
One can use the Diamond libraries like the JDBC (Java many more.
operator to specify a generic Database Connectivity), JNDI (Java It uses a library along with the
interface in place of writing the Naming and Directory Interface), RMI files given by JRE (Java
exact one. (Remote Method Invocation), and Runtime Environment) for
many more. running the program.
Any user can easily install JDK on
Unix, Mac, and Windows OS It consists of the JVM and virtual Both JRE and JDK contain JVM.
(Operating Systems). machine client for Java HotSpot.
It is easily customizable. For
instance, a user can feasibly
allocate a maximum and
minimum memory to it.
Keep learning and stay tuned to get the latest updates on GATE Exam (https://byjus.com/gate/gate-exam/) along with GATE Eligibility
Criteria (https://byjus.com/gate/gate-eligibility-criteria/), GATE 2023 (https://byjus.com/gate/), GATE Admit Card
(https://byjus.com/gate/gate-admit-card/), GATE Application Form (https://byjus.com/gate/gate-application-form/), GATE Syllabus
(https://byjus.com/gate/gate-syllabus/), GATE Cut off (https://byjus.com/gate/gate-cutoff/), GATE Previous Year Question Paper
(https://byjus.com/gate/previous-year-question-papers/), and more.