• Home
  • Subscribe
  • Contribute Us
    • Share Your Interview Experience
  • Contact Us
  • About
    • About CSEstack
    • Campus Ambassador
  • Forum & Discus
  • Tools for Geek
  • LeaderBoard
CSEstack

What do you want to Learn Today?

  • Programming
    • Tutorial- C/C++
    • Tutorial- Django
    • Tutorial- Git
    • Tutorial- HTML & CSS
    • Tutorial- Java
    • Tutorial- MySQL
    • Tutorial- Python
    • Competitive Coding Challenges
  • CSE Subject
    • (CD) Compiler Design
    • (CN) Computer Network
    • (COA) Computer Organization & Architecture
    • (DBMS) Database Management System
    • (DS) Data Structure
    • (OS) Operating System
    • (ToA) Theory of Automata
    • (WT) Web Technology
  • Interview Questions
    • Interview Questions- Company Wise
    • Interview Questions- Coding Round
    • Interview Questions- Python
    • Interview Questions- REST API
    • Interview Questions- Web Scraping
    • Interview Questions- HR Round
    • Aptitude Preparation Guide
  • GATE 2022
  • Linux
  • Trend
    • Full Stack Development
    • Artificial Intelligence (AI)
    • BigData
    • Cloud Computing
    • Machine Learning (ML)
  • Write for Us
    • Submit Article
    • Submit Source Code or Program
    • Share Your Interview Experience
  • Tools
    • IDE
    • CV Builder
    • Other Tools …
  • Jobs

Difference between JRE, JDK and JVM in Java [Interview Questions]

Heena Rajpal/16164/2
CodeJAVA

We often come across the difference between JRE, JDK and JVM when we are introduced to JAVA. In many interviews, you will be asked questions related to the JDK and JVM.

However, most of us are unable to establish that clear line of difference between these terms and the vagueness and similarities in names and definitions often confuses us.

Difference between JRE, JDK and JVM in Java

Difference between JRE, JDK and JVM in Java?

So if you are one of those people, read on to get clarification of concepts and clear that long-lasting doubt from your mind.

Java Environments

  • JVM- Java Virtual Machine
  • JRE- Java Runtime Enviroment
  • JDK- Java Development Kit
  • Difference between JVM, JRE and JDK
  • JIT- Just in Time Compiler

What is the Java Virtual Machine (JVM)?

First of all, let us talk about the Java Virtual Machine. Before getting introduced to this term, we go through various features of Java like robustness, object-oriented, strongly typed, platform independence and so on.

Platform independence is the most important one among them, which means that once compiled, the bytecode can be executed on any machine.

But how is this achieved? How can machines with different architectures and operating systems run the same code?

This is possible because Java creates its own machine (virtual) to run on which makes it independent of other machines. This is JVM.

So what is the use of JVM?

JVM loads, verifies and executes code and gives the code a virtual machine or an environment to run on. It is a kind of interpreter. It also provides memory management and garbage collection functions.

What is the Java Run Time Environment (JRE)?

Java Run Time Environment provides everything that is needed to run a program. It mainly includes the environment to run the program along with the set of libraries or functions that are necessary for the execution of a program.

However, JRE cannot alone help us develop a program. It is physical (not virtual) and provides us with features to simply runs them.

What is the Java Development Kit (JDK)?

JDK is a kit, which means a collection of tools or a bundle of software components to compile as well as run the program.

It contains the environment to bytecode the program but also helps a programmer to develop applications. It consists of a compiler and debugger as well.

Java development kit is an implementation of Java SE, Java EE or Java ME. We often begin with Java SE to get a grip on the basic features of Java.

So, I hope this clarifies the difference between JRE, JDK and JVM in Java.

Difference between JVM, JRE and JDK

In case there’s still a doubt, I’d share with you three simple lines that my teacher asked me to always remember which assures that I do not get confused between these terms.

They are:

JVM: Virtual Machine for platform independence
JRE: JVM + API
JDK: Compiler + JVM + API (or JRE + API)

Here, API stands for Application Programming Interface, or simply stated, a set of functionalities or a library.

Understanding these differences is very important. If you are applying for a Java developer role, in interviews, you will be asked questions on this topics.

We may also come across a term, Just in Time Compiler (JIT).

What is Just in Time Compiler (JIT Compiler)?

It is simply a module or component or a subset of JRE. It compiles some part the byte code into machine code along with working to improve the efficiency of the program. Rest all parts of the bytecode are interpreted and executed.

Note if you are installing Java on your system. When we are working with Java, we need to install only two packages, JDK and JRE. All other functionalities and tools are available in them itself.

You may like to read:

  • If you are new to Java programming, you can read the complete installation setup guide for Java. So what are you waiting for? Install JDK and start coding.
  • Most common errors and fixes for JVM.
  • You may come across different environment variable in Java.  You can read the difference between path and classpath environment variable in Java.

Hope this is a quick guide for finding the difference between JRE, JDK and JVM and to start with Java. If you are Java developer, you can follow the Java programming sections to get updated with.

Happy Codding!

JavaJava JDK
Heena Rajpal
Heena Rajpal is pursuing Computer Science Engineering from Indore. She has a knack for writing and an inquisitive outlook towards Computer Science fields like Database Management Systems, Object Oriented Programming and languages like C, C++, JAVA, Python, HTML etc.

Your name can also be listed here. Got a tip? Submit it here to become an CSEstack author.

Comments

  • Reply
    Rahul
    February 20, 2017 at 1:10 pm

    This I feel is a wonderful platform to work with

  • Reply
    priya
    July 27, 2018 at 12:46 pm

    Jdk is java Java Development Tool Kit which contains JVM, JRE and other development tools and libraries. JVM is a Java Virtual Machine that provides runtime environment to run the java code/application.

Leave a Reply Cancel reply

Basic Java Tutorial

  1. Java- Tutorial Overview
  2. Java- Features & Characteristics
  3. Java-  Installation & Setup
  4. Java- Hello, World Program!
  5. Java- JDK vs JVM vs JRE
  6. Java- Data Types & Variables
  7. Java- String & its Methods
  8. Java- Different Operators Types
  9. Java- Flow Control Statements
  10. Java- Array
  11. Java- Exception Handling
  12. Java- ‘throw’ vs ‘throws’ Keyword
  13. Java- RegEx
  14. Java 12- New Advanced Features

Java OOPs concepts

  1. Java- OOPs Introduction
  2. Java- Classes & Objects
  3. Java- Constructor & Overloading
  4. Java- Method Overload vs Override
  5. Java- Access Modifiers
  6. Java- Abstraction
  7. Java- Inheritance
  8. Java- Interfaces
  9. Java- Nested Inner Classes

Java Advanced

  1. Java- Applet vs Application
  2. Java- HashMap Collections
  3. Java- ArrayList
  4. Java- LinkedList
  5. Java- HashSet
  6. Java- HashMap vs HashSet
  7. Java- Reverse Linked List

Java Exercise

50+ Java Coding Questions [Practice]

Java Projects

Patient Billing Software

© 2022 – CSEstack.org. All Rights Reserved.

  • Home
  • Subscribe
  • Contribute Us
    • Share Your Interview Experience
  • Contact Us
  • About
    • About CSEstack
    • Campus Ambassador
  • Forum & Discus
  • Tools for Geek
  • LeaderBoard