Java Tutorials
Java ArrayList: How to Use, ArrayList Methods & Examples
What is ArrayList in Java? ArrayList in Java is a data structure that can be stretched to...
JDK is a software development environment used for making applets and Java applications. The full form of JDK is Java Development Kit. Java developers can use it on Windows, macOS, Solaris, and Linux. JDK helps them to code and run Java programs. It is possible to install more than one JDK version on the same computer.
In this tutorial, you will learn:
JRE is a piece of a software which is designed to run other software. It contains the class libraries, loader class, and JVM. In simple terms, if you want to run Java program you need JRE. If you are not a programmer, you don't need to install JDK, but just JRE to run Java programs. Though, all JDK versions comes bundled with Java Runtime Environment, so you do not need to download and install the JRE separately in your PC. The full form of JRE is Java Runtime Environment.
JVM is an engine that provides a runtime environment to drive the Java Code or applications. It converts Java bytecode into machine language. JVM is a part of Java Run Environment (JRE). It cannot be separately downloaded and installed. To install JVM, you need to install JRE. The full form of JVM is Java Virtual Machine.
In many other programming languages, the compiler produces machine code for a specific system. However, Java compiler produces code for a virtual machine which is called as JVM.
Here are the important reasons of using JDK:
Here are the important reasons of using JRE:
Here are the important reasons of using JVM:
Here are the important features of JDK:
Here are the important features of JRE:
Here are the important features of JVM:
Here are the important components of JDK:
JRE has an instance of JVM with it, library classes, and development tools. Once you write and compile Java code, the compiler generates a class file having byte code.
Here are the important components of JRE:
In this way, the Java program runs in JRE.
Here are the important components of JVM:
1) Class Loader
The class loader is a subsystem used for loading class files. It performs three major functions viz. Loading, Linking, and Initialization.
2) Method Area
JVM Method Area stores structure of class like metadata, the code for Java methods, and the constant runtime pool.
3) Heap
All the Objects, arrays, and instance variables are stored in a heap. This memory is shared across multiple threads.
4) JVM language Stacks
Java language Stacks store local variables, and its partial results. Each and every thread has its own JVM language stack, created concurrently as the thread is created. A new frame is created when method is invoked, and it is removed when method invocation process is complete.
5) PC Registers
PC registers store the address of the Java virtual machine instruction, which is currently executing. In Java, each thread has its separate PC register.
6) Native Method Stacks
Native method stacks hold the instruction of native code depends on the native library. It allocates memory on native heaps or uses any type of stack.
7) Execution Engine
It is a type of software that is used to test software, hardware, or complete systems. The test execution engine never carries any information about the tested product.
8) Native Method interface
The Native Method Interface is a programming framework. It allows Java code, which is running in a JVM to call by libraries and native applications.
9) Native Method Libraries
Native Libraries is a collection of the Native Libraries (C, C++), which are needed by the Execution Engine.
Here are the major differences between JDK vs. JRE vs. JVM:
JDK | JRE | JVM |
The full form of JDK is Java Development Kit. | The full form of JRE is Java Runtime Environment. | The full form of JVM is Java Virtual Machine. |
JDK is a software development kit to develop applications in Java. | It is a software bundle which provides Java class libraries with necessary components to run Java code. | JVM executes Java byte code and provides an environment for executing it. |
JDK is platform dependent. | JRE is also platform dependent. | JVM is platform-independent. |
It contains tools for developing, debugging, and monitoring java code. | It contains class libraries and other supporting files that JVM requires to execute the program. | Software development tools are not included in JVM. |
It is the superset of JRE | It is the subset of JDK. | JVM is a subset of JRE. |
The JDK enables developers to create Java programs that can be executed and run by the JRE and JVM. | The JRE is the part of Java that creates the JVM. | It is the Java platform component that executes source code. |
JDK comes with the installer. | JRE only contain environment to execute source code. | JVM bundled in both software JDK and JRE. |
What is ArrayList in Java? ArrayList in Java is a data structure that can be stretched to...
JavaScript is an open-source and most popular client-side scripting language supported by all...
$20.20 $9.99 for today 4.6 (115 ratings) Key Highlights of Java Programming Language PDF 265+...
What is Spring Framework? Spring Framework is an open-source framework for building web...
What is String "Length" Method in Java? This function is used to get the length of string in Java....
What is TypeScript? TypeScript is a superset of JavaScript. TypeScript is pure object-oriented...