What is the difference between JRE, JDK, JVM and JIT?_Summary of basic knowledge of java

The following terms have different meanings when it comes to Java programming and execution:

1.JRE (Java Runtime Environment)

JRE is an acronym for Java Runtime Environment. It is a collection of components that contain the components needed to run Java applications on a computer. JRE includes the following main parts:

Java Virtual Machine (JVM): A virtual machine used to execute Java bytecode, translate bytecode into local machine code and execute it.

·Java Core Class Library: A set of predefined classes and methods for handling common tasks such as input and output, data structures, network communications, and more.

· Supporting files: Contains necessary files, such as fonts, property files, etc., to support the normal operation of Java applications.

2.JDK (Java Development Kit)

JDK is an acronym for Java Development Kit. It is a software package for developing Java applications, including compilers, debuggers, libraries, and other development tools. The JDK includes the JRE because developers need to be able to compile, debug, and test their code during development. The main components of the JDK include:

Compiler: A tool that compiles Java source code into bytecode.

· Debugger: Used to debug code, find errors and problems.

· Core class library: Same as the class library in the JRE, used to handle various tasks during the development process.

·Development tools: including various auxiliary development tools, such as integrated development environment (IDE), construction tools, etc.

3.JVM (Java Virtual Machine)

JVM is the abbreviation of Java Virtual Machine, which is a virtual computer that runs Java bytecode. The JVM is the part of the JRE that is responsible for actually executing Java programs on the computer. It has the following main functions:

· Class Loading: Load the compiled bytecode into memory.

·Bytecode Execution: Interpret or compile bytecode into local machine code and execute it on the computer.

· Memory management: Automatically manages memory allocation and garbage collection.

·Security Management: Control the access rights and security of Java applications.

4.JIT (Just-In-Time Compiler)

The JIT compiler is a part of the JVM. It is a special compiler used to dynamically compile Java bytecode into local machine code to improve program execution performance. The JIT compiler optimizes according to the execution of the program at runtime, and compiles frequently executed code into local machine code, thereby accelerating the execution speed of the program. The JIT compiler improves the performance of Java programs by eliminating unnecessary runtime interpretation and optimizing the code execution path.

At the end of the article, briefly summarize the relationship between the above terms: JRE is the environment required to run Java programs on a computer, JDK is a tool set for developing Java programs, JVM is a virtual machine that actually executes Java bytecodes, and JIT is a part of JVM that is used to compile bytecode into native machine code to improve execution performance.

Guess you like

Origin blog.csdn.net/cz_00001/article/details/132346496