TechBeamersTechBeamers
  • Learn ProgrammingLearn Programming
    • Python Programming
      • Python Basic
      • Python OOP
      • Python Pandas
      • Python PIP
      • Python Advanced
      • Python Selenium
    • Python Examples
    • Selenium Tutorials
      • Selenium with Java
      • Selenium with Python
    • Software Testing Tutorials
    • Java Programming
      • Java Basic
      • Java Flow Control
      • Java OOP
    • C Programming
    • Linux Commands
    • MySQL Commands
    • Agile in Software
    • AngularJS Guides
    • Android Tutorials
  • Interview PrepInterview Prep
    • SQL Interview Questions
    • Testing Interview Q&A
    • Python Interview Q&A
    • Selenium Interview Q&A
    • C Sharp Interview Q&A
    • PHP Interview Questions
    • Java Interview Questions
    • Web Development Q&A
  • Self AssessmentSelf Assessment
    • Python Test
    • Java Online Test
    • Selenium Quiz
    • Testing Quiz
    • HTML CSS Quiz
    • Shell Script Test
    • C/C++ Coding Test
Search
  • Python Multiline String
  • Python Multiline Comment
  • Python Iterate String
  • Python Dictionary
  • Python Lists
  • Python List Contains
  • Page Object Model
  • TestNG Annotations
  • Python Function Quiz
  • Python String Quiz
  • Python OOP Test
  • Java Spring Test
  • Java Collection Quiz
  • JavaScript Skill Test
  • Selenium Skill Test
  • Selenium Python Quiz
  • Shell Scripting Test
  • Latest Python Q&A
  • CSharp Coding Q&A
  • SQL Query Question
  • Top Selenium Q&A
  • Top QA Questions
  • Latest Testing Q&A
  • REST API Questions
  • Linux Interview Q&A
  • Shell Script Questions
© 2024 TechBeamers. All Rights Reserved.
Reading: Introduction to JVM, JDK, JRE
Font ResizerAa
TechBeamersTechBeamers
Font ResizerAa
  • Python
  • SQL
  • C
  • Java
  • Testing
  • Selenium
  • Agile Concepts Simplified
  • Linux
  • MySQL
  • Python Quizzes
  • Java Quiz
  • Testing Quiz
  • Shell Script Quiz
  • WebDev Interview
  • Python Basic
  • Python Examples
  • Python Advanced
  • Python OOP
  • Python Selenium
  • General Tech
Search
  • Programming Tutorials
    • Python Tutorial
    • Python Examples
    • Java Tutorial
    • C Tutorial
    • MySQL Tutorial
    • Selenium Tutorial
    • Testing Tutorial
  • Top Interview Q&A
    • SQL Interview
    • Web Dev Interview
  • Best Coding Quiz
    • Python Quizzes
    • Java Quiz
    • Testing Quiz
    • ShellScript Quiz
Follow US
© 2024 TechBeamers. All Rights Reserved.
Java BasicJava Tutorials

Introduction to JVM, JDK, JRE

Last updated: Sep 23, 2023 3:37 pm
By Meenakshi Agarwal
Share
8 Min Read
JVM vs JRE vs JDK
SHARE

This tutorial provides a basic Introduction to JVM, JDK, and JRE. These are the three main Java components, and you should know what they are and how they work.

Contents
The A B Cs of JavaHow does a Java program execute?Explain JVMJVM Memory AreasJVM Execution EngineWhat is JDK?How does JRE work?Compare JVM, JDK, and JRE

Introduction to JVM, JDK, JRE – Basics of Java

Learn about the prerequisites of programming in Java. The major topics covered are as follows:

The A B Cs of Java

Learning a new language is indeed a difficult task. But with a precise chronology and an excellent comprehensive guide, acquiring the skillset can be easy. Before trying to make long sentences, one should get well-equipped with the basics of the language.

The same pattern goes for Java. Before writing 1000 lines of code, we should try to figure out what happens in the background when you hit that run button or how your code gets compiled!

How does a Java program execute?

1. First, you need to create a Java file and write code. You can do it either using a text editor or IDE (integrated development environment) and save it as XYZ.java.

2. Secondly, you compile the Java file using the JAVAC compiler. It converts the source into bytecode and generates an XYZ.class file.

3. This XYZ.class file runs with the help of JVM (Java virtual machine).

4. The JVM first translates the class file into computer-readable machine code and then executes it.

How JVM executes Java program

Explain JVM

It is also known as Java Virtual Machine. It acts as a run-time motor to run Java applications. JVM is the one that calls the entry-point “main” method. JVM is a piece of JRE(Java Runtime Environment).

An engineer can create Java code on one framework and can anticipate that it should keep running on some other Java-empowered framework with no modification. It is all conceivable due to JVM.

When we assemble a .java document, the Java compiler produces the .class files with similar names present in the .java record. This .class document goes into different advances when we run it. These means together depict the entire JVM.

JVM conveys the ideal execution for Java applications utilizing many propelled strategies, fusing a best-in-class memory display/model, garbage collector, and versatile, adaptive optimizer.

The server VM has been uncommonly tuned to amplify the top working rate. It has to run for long-running server applications, which requires the quickest conceivable and active velocity over a quick start-up time. Engineers can pick which framework they need by determining – customer or – server.

The JVM is virtual because it gives a machine interface that does not rely upon the basic working framework and machine equipment design. This freedom from equipment and the working structure is a foundation of the write once-run-anyplace estimation of Java programs.

JVM Architecture

The class loader is a subsystem utilized for stacking .class files. It performs three noteworthy capacities, i.e., class loading, linking, and initialization.

Must Read Tutorial – Java Multithreading

JVM Memory Areas

Memory territory inside JVM is isolated into numerous parts to store specific pieces of information.

The heap stores all objects that get created amid application execution.

Method Area – It stores class structures like metadata, the steady runtime pool, and the code for methods.

Stacks store nearby objects and intermediate outcomes. Every such variable is nearby to the thread under which it operates. Each thread has its own JVM stack, spawned simultaneously.

PC registers store the physical memory address of the lines that are under execution. In Java, each thread has its different PC register.

JVM Execution Engine

All code relegated to JVM executes under the scheme that the byte code gets read and interpreted one by one. It utilizes two inbuilt translators and a compiler to change over the bytecode to machine code and execute it.

With JVM, both the Interpreter and compiler deliver native code. The thing that matters is that they create the “code,” how enhanced it is, and how expensive the advancement is.

What is JDK?

JDK contains everything that JRE has alongside improvement devices for creating, troubleshooting, and observing Java applications. You require JDK when you have to build Java applications.

The Java Development Kit (JDK) provides an environment utilized for creating Java applications and applets. It incorporates the Java Runtime Environment (JRE), a loader, a compiler (javac), an archiver (jar), a documentation generator (Javadoc), and different apparatuses required in Java improvement.

How does JRE work?

The Java Runtime Environment (JRE) is a product bundle that packages the libraries (containers), the Java Virtual Machine, and different parts to run applications written in Java. JVM is only a piece of JRE dispersions.

In order to run any Java application, the presence of the Java Runtime Environment (JRE) on the machine is essential. It serves as a fundamental requirement for executing Java applications on any device.

JREs come as a feature of JDKs, or you can download them independently. JREs are dependent on the kind of machine (OS and engineering). You should choose the JRE package to import and introduce.

Java Worflow Diagram

Compare JVM, JDK, and JRE

JVM is the virtual engine and one that enables byte code support.

JRE contains JVM and all the other libraries to run Java applications. It is enough to run any Java application.

JDK is a superset that comprises JVM, JRE, and the tools to develop Java Applications. Its primary objective is to provide support for the build and compilation.

JVM vs JRE vs JDK

Short Summary to “Introduction to JVM, JDK, JRE”

In conclusion, the JVM, JDK, and JRE are essential components of the Java platform. The JVM serves as a runtime environment, executing Java bytecode on different devices. The JDK provides tools, libraries, and compilers for Java development, enabling the creation of robust applications.

The JRE includes the necessary components to run Java applications, including the JVM. Understanding these components is crucial for learning Java, enabling in-depth development, and executing Java programs efficiently.

If you have found this tutorial on “Introduction to JVM, JDK, JRE” valuable, please consider sharing it with others to help them benefit from it as well.

Thanks,

TechBeamers.

You Might Also Like

A Simple Guide to Exception Handling in Java

Difference Between Spring and Spring Boot

How to Use Java String Format with Examples

Java IRC Bot with Sample Code

Generate Random Number in Java – 10 Ways

Meenakshi Agarwal Avatar
By Meenakshi Agarwal
Follow:
Hi, I'm Meenakshi Agarwal. I have a Bachelor's degree in Computer Science and a Master's degree in Computer Applications. After spending over a decade in large MNCs, I gained extensive experience in programming, coding, software development, testing, and automation. Now, I share my knowledge through tutorials, quizzes, and interview questions on Python, Java, Selenium, SQL, and C# on my blog, TechBeamers.com.
Previous Article Pylint Tool Usage How to Use Pylint in Python
Next Article Write Your First Java Program Write Your First Java Program

Popular Tutorials

SQL Interview Questions List
50 SQL Practice Questions for Good Results in Interview
SQL Interview Nov 01, 2016
Demo Websites You Need to Practice Selenium
7 Sites to Practice Selenium for Free in 2024
Selenium Tutorial Feb 08, 2016
SQL Exercises with Sample Table and Demo Data
SQL Exercises – Complex Queries
SQL Interview May 10, 2020
Java Coding Questions for Software Testers
15 Java Coding Questions for Testers
Selenium Tutorial Jun 17, 2016
30 Quick Python Programming Questions On List, Tuple & Dictionary
30 Python Programming Questions On List, Tuple, and Dictionary
Python Basic Python Tutorials Oct 07, 2016
//
Our tutorials are written by real people who’ve put in the time to research and test thoroughly. Whether you’re a beginner or a pro, our tutorials will guide you through everything you need to learn a programming language.

Top Coding Tips

  • PYTHON TIPS
  • PANDAS TIPSNew
  • DATA ANALYSIS TIPS
  • SELENIUM TIPS
  • C CODING TIPS
  • GDB DEBUG TIPS
  • SQL TIPS & TRICKS

Top Tutorials

  • PYTHON TUTORIAL FOR BEGINNERS
  • SELENIUM WEBDRIVER TUTORIAL
  • SELENIUM PYTHON TUTORIAL
  • SELENIUM DEMO WEBSITESHot
  • TESTNG TUTORIALS FOR BEGINNERS
  • PYTHON MULTITHREADING TUTORIAL
  • JAVA MULTITHREADING TUTORIAL

Sign Up for Our Newsletter

Subscribe to our newsletter to get our newest articles instantly!

Loading
TechBeamersTechBeamers
Follow US
© 2024 TechBeamers. All Rights Reserved.
  • About
  • Contact
  • Disclaimer
  • Privacy Policy
  • Terms of Use
TechBeamers Newsletter - Subscribe for Latest Updates
Join Us!

Subscribe to our newsletter and never miss the latest tech tutorials, quizzes, and tips.

Loading
Zero spam, Unsubscribe at any time.
x