Difference between JDK, JVM and JRE

As a Java programmer, it is very important aspect to understand what exactly is JDK, JVM and JRE. Even in interviews, most of the interviewers ask difference between JDk, JVM and JRE to check the deep/logical understanding of JDK, JVM and JRE of candidate. Today in this article we will understand various difference between JDK, JVM and JRE.

Java Virtual Machine(JVM)

 As a developer, we write a Java program i.e *.java file. Further we compile the Java program and the *.class file is generated which is also known as bytecode. Now to execute this byte code we need a something. But what exactly is that? Java Virtual Machine(JVM) is a virtual machine which runs the Java bytecode/.class file and generates the output. Every platform for example:- Linux, Windows, Mac-OS has their own JVM, which makes Java program prossible to write once and run anywhere. For example if you compile your program on Windows operating system, you can run the same program on any operating system and produce the same output as shown in below diagram:
JVM Platform Independent

Java Runtime Environment(JRE)

Java Runtime Environment provides all necessary libraries and files which is required by JVM to execute any bytecode/.class file. For example: If you want to run any applet on your browser you have to install JRE on your system.

JRE JVM

Java Development Kit(JDK)

 JDK also known as Java Development Kit which provides all necessary tools to develop any Java application as well as run it.. 

Hence, JDK = Tools Required to develop Java application + JRE

The tools provided by JDK to develop Java application are listed below:

  • Java Compiler
  • Java Debugger
  • Java Applet Viewer etc.

JDK JRE JVM

In this article, you have learnt about JDK, JRE and JVM as well as key difference between each of them.

Article tagged as
Author
Author: Amit Gupta
Published On: 09/02/2016
Last revised On: 13/02/2016
View all articles by Amit Gupta

Share this post

Comments

Comments
comments powered by Disqus

Navigation

Social Media