JDK vs JRE vs JVM
By looking at the terms you should know these components are associated with java. Each of these components performs a unique task relevant to java development. So in this article we are going to understand the functionalities and the differences of each of these components.
JDK (Java Development Kit)
Java development Kit is the software development environment used to develop java programs. It consists of JRE(Java Runtime Environment), libraries, compiler, a documentation generator (Javadoc), Interpreter and other tools needed in java application development.
Java development Kit exists physically. (Consisted with JRE + development tools)
JDK is an implementation of any of Oracle Corporation’s Java Platforms, as listed below:
- Standard Edition Java Platform
- Enterprise Edition Java Platform
- Micro Edition Java Platform
- JDK is highly platform dependent, It means the JDK for windows operating system will not work for a Linux environment. We have to select the JDK relevant to our specific platform. If not, Java language will not work.
- JDK is in charge of primary development, it includes tools for creating, debugging, and monitoring Java applications.
- For your reference here I have included some of the components that lie within JDK, These components will not be discussed through this article. Which will be discussed in the future. Here I have mentioned a few of them.
Appletviewer
Used to run and debug Java applets without a web browser.
Apt
Annotation-processing tool.
Extcheck
A utility that detects JAR file conflicts.
Javac
Specifies the Java compiler, converts source code into Java bytecode.
Javadoc
The documentation generator.
Jar
Specifies the archiver, helps to manage JAR files.
Javafxpackager
It is a tool to package and sign JavaFX applications.
Architectural View
JRE (Java Runtime Environment)
- JRE stands for Java Runtime Environment, Java runtime environment is the implementation of JVM. JRE provides an environment to run java programs.
- JRE consists of Java Virtual Machine, core classes and supporting files in order to provide implementations.
- Exists physically, It comprises a collection of libraries as well as other files that JVM uses during execution.
- Major responsibility of the JRE is to provide the environment for code execution.
- Similarly as to JDK, JRE is also platform dependent which means we have to have JRE compatible for relevant platforms. Otherwise the language will not function.
- Does not contain any tools such as compilers or debuggers etc. Rather, it contains the class libraries and other supporting files required by JVM to run the program.
JRE consist of following components
- Deployment Technologies
- User Interface Tool kits
- Integration Libraries
- Other base Libraries
- Lang and Util base Libraries
- Java Virtual Machine
Following actions occur at run time
- Class Loader
- ByteCode Verifier
- Interpreter
- Execute the Byte Code
- Make appropriate calls to the underlying hardware
JVM (Java Virtual Machine)
- JVM is a process or a program which is not a physical entity; that holds specifications which are relevant to java.
- JVM, on the other hand, specifies all implementations and is responsible for providing them to JRE.
- Can not install or download JVM, because it does not exist as a physical entity.
- When a Java program runs, JVM becomes an instance of JRE.
JVM is platform dependent, JVM comes with JRE so if we download a JRE for a windows platform then JRE will implement the code segment to create a JVM for windows environment. Similarly this happens for all the other platforms as well.
JVM Consist of 3 Main Components, they as follows
- Class Loader
- Memory Area
- Execution Engine
- JVM will perform many core functionalities such as it will be responsible to load the class and store relevant details and finally execute the java code.
- These aspects are discussed thoroughly in the below given article. Here I have attached the link for your reference.
Article Link: Understanding The Core Concepts Behind JVM, JRE and JDK in Java. | by Oshan Vikasith | Feb, 2022 | Medium | Medium
- Functionality of the major components are discussed in the above mentioned article.
- You can get a much more clear idea about JVM through the above article.
JVM Architecture
Hope you got a clear and better understanding regarding the core fundamental aspects of java. Hope to see you again in a future article, Thank you for reading !
Here I have included the sources which I have referred.
JDK | Java Development Kit — Javatpoint
Difference between JDK, JRE and JVM — javatpoint
What is the difference between JDK, JRE, and JVM? (tutorialspoint.com)