What are the connections and differences between JDK, JRE, and JVM?

Insert picture description here
JDK: the full name of java development kit, development kit, for our developers, to provide developers with development libraries, he is the core of java. JDK contains JRE, a bunch of tool classes (javac, java), JAVA class library (Object, String)
JRE: the full name of java runtime environment. Contains JVM standard implementation and required class libraries. JRE is an operating environment, not a development tool.
JVM: It is a virtual computer, which is realized by simulating various computer functions on the actual computer. JVM has its own complete hardware architecture, such as processors, stacks, registers, etc., as well as corresponding instruction systems. The most important feature of java language is cross-platform operation. Using JVM is to achieve cross-platform.
The connection of the three:
JVM cannot handle the class file separately. When interpreting the class, jvm (D:\JDK\bin) needs to call the class library (D:\JDK\lib) we need. JVM +lib = JRE Generally speaking, we use JDK to develop our own programs, compile them through the javac toolkit of JDK, and compile java files as class files (bytecode files), and run these on JRE The JVM performed the translation of these files.
The difference between the three: The difference between
JDK and JRE: jdk is a development kit, including JRE; JRE is the operating environment, and does not provide a development kit.
The difference between JRE and JVM: JRE includes JVM, JRE = JVM + lib. JRE provides a running environment for class files, but requires JVM to translate class files. JVM transfers the translated files to the os system or the CPU mapping instruction set to finally complete the operation.
Insert picture description here
From the figure we can see that when we click on our main method, a background process is created, and a javaw.exe is created with eclipse. javaw.exe is our big virtual machine. (I clicked the main method n times and found that n jvm virtual machines were created, that is,

Guess you like

Origin blog.csdn.net/GTC_GZ/article/details/107593148