Core JavaJava Interview Questions

Difference between JDK, JRE and JVM

Posted On
Posted By admin

In this blog post, I am going to explain the JVM, JRE and JDK and how they differ from each other.

JVM

JVM stands for Java Virtual Machine. It provides the environment to execute the Java byte code. As you probably know, Java is platform independent i.e. the same Java class file can be run on any operating system. It is the JVM which makes Java platform independent. When you compile code written in other programming languages, it creates files that are operating system specific. When you compile Java code, it is compiled into platform independent bytecode which is present in the .class file created after compilation. The JVM understands and executes this bytecode. So the JVM its on top of the operating system and runs the bytecode making Java platform independent.

JRE

JRE stands for Java Runtime Environment. JVM executes the bytecode from the .class file. However, in addition to the JVM, some additional libraries or jar files are required. So the JRE consists of these libraries and the JVM. The JRE supplies the libraries and the .class file to the JVM in order to execute the bytecode. JRE is used by anyone who wants to run Java code.

 

JDK

It stands for Java Development Kit.  The JRE provides the environment to only execute your Java code. However, if you want to write Java code, you need the JDK So when you write Java code, you will need tools to compile the Java program, you will need an archiver to generate the JAR file, etc. So JDK consists of all these tools required for Java development as well we the JRE. JDK is only used by Java developers.

 

 

If you'd like to watch a detailed video tutorial of this topic or other related topics, do check out my Java course here

Also, if you'd like to test your Java knowledge, do check out my practice tests course here


If you like this post, please do let me know via the comments box below.  You can also connect with me via my Facebook Page or subscribe to my Youtube channel!

Related Post

2 thoughts on “Difference between JDK, JRE and JVM
  1. ssebalu innocent

    Please I like the post. Also tell me how to make my eclipse become compatible with Java. When ever I start window builder, it says it’s not compatible

    • admin

      Sorry, but I dont understand what you mean? Do you want to install JDK in Java?

leave a Comment