Java tutorials for Beginners – Java JDK, JRE and JVM

(Java programming Example for Beginners)

Java JDK, JRE and JVM

In this tutorial, you will learn about JDK, JRE, and JVM. You will also learn the key differences between them.

What is JVM?

JVM (Java Virtual Machine) is an abstract machine that enables your computer to run a Java program.

When you run the Java program, Java compiler first compiles your Java code to bytecode. Then, the JVM translates bytecode into native machine code (set of instructions that a computer’s CPU executes directly).

Java is a platform-independent language. It’s because when you write Java code, it’s ultimately written for JVM but not your physical machine (computer). Since JVM ​executes the Java bytecode which is platform-independent, Java is platform-independent.

How does Java program work?
Working of Java Program

 


What is JRE?

JRE (Java Runtime Environment) is a software package that provides Java class libraries, Java Virtual Machine (JVM), and other components that are required to run Java applications.

JRE is the superset of JVM.

JRE contains JVM and other Java class libraries.
Java Runtime Environment

If you need to run Java programs, but not develop them, JRE is what you need. You can download JRE from Java SE Runtime Environment 8 Downloads page.


What is JDK?

JDK (Java Development Kit) is a software development kit required to develop applications in Java. When you download JDK, JRE is also downloaded with it.

In addition to JRE, JDK also contains a number of development tools (compilers, JavaDoc, Java Debugger, etc).

JDK contains JRE and other tools to develop Java applications.
Java Development Kit

If you want to develop Java applications, download JDK.


Relationship between JVM, JRE, and JDK.

JRE contains JVM and class libraries and JDK contains JRE, compilers, debuggers, and JavaDoc
Relationship between JVM, JRE, and JDK

Sign up to get end-to-end “Learn By Coding” example.



Disclaimer: The information and code presented within this recipe/tutorial is only for educational and coaching purposes for beginners and developers. Anyone can practice and apply the recipe/tutorial presented here, but the reader is taking full responsibility for his/her actions. The author (content curator) of this recipe (code / program) has made every effort to ensure the accuracy of the information was correct at time of publication. The author (content curator) does not assume and hereby disclaims any liability to any party for any loss, damage, or disruption caused by errors or omissions, whether such errors or omissions result from accident, negligence, or any other cause. The information presented here could also be found in public knowledge domains.