Introduce to JDK, JRE and JVM in Java:
Understanding the differences between JDK, JRE and JVM is quite important in Java. Here, we present a brief description of the JVM, for more details on it, go to the next chapter. We first learn the basic differences between JDK, JRE and JVM.About the JVM
JVM (short for Java Virtual Machine) is an abstract (virtual) device that can help computers run Java programs. It provides the runtime environment in which Java Bytecode can be executed.JVM is available for many platforms (Windows, Linux ...). JVM, JRE and JDK are platform dependent, because the configuration of each OS (OS) is different. But, Java is platform independent.
What is a JVM?
JVM performs the following major tasks:- Download code.
- Check code.
- Execute the code.
- Provides runtime environment.
JVM provides definitions for: memory area, class file format, registry settings, garbage collector heap, and fatal error reports.
The internal structure of the JVM
You follow the following diagram to understand the internal structure of the JVM. It includes Classloader, Memory Area, Excetution Engine, ...
- Classloader: A subsystem of the JVM used to load class files.
- Class (method) Area: Store structure of each class, such as constant, field, method data, method code, ...
- Heap: It is the runtime data area in which the object is allocated.
- Stack: Stack in Java stores frames. It keeps local variables and local results, and performs part of the task in the summon and returns the method. Each Thread has its own Stack, created at the same time as Thread.
- A new frame is created each time a method is summoned and destroyed when the summon method is terminated.
- Program Counter Register: It contains the address of the current JVM instruction being executed.
- Native Method Stack: Includes all natural methods used in the application.
- Execution Engine: This section includes: A virtual processor, An interpreter software. Read Stream Bytecode then executes the directive. Just-In-Time (JIT) Compiler: Used to improve performance. JIT compiles parts of Bytecode that have the same features at the same time, and thus reduces the amount of time required to compile. The concept of a compiler is a compiler for the instruction set of the JVM to be the instruction set of a specific CPU.
Introduction to JRE
JRE (short for Java Runtime Environment) is used to provide a runtime environment. It is a JVM implementer. The JRE includes a set of libraries and other files that the JVM uses at runtime. The JVM deployment is also announced by companies other than Sun Microsystems.Overview of JAVA
JDK (short for Java Development Kit) includes the JRE and the Development Tool.
To find out more about do while loop java statement example:
Comments
Post a Comment