jvm,jre,jdk

1, JVM: JVM is an acronym for Java Virtual Machine (Java Virtual Machine), which is the whole core java achieve cross-platform part, all the java programming will first be compiled into class files .class, which can be in the class file execution on a virtual machine, that class does not correspond directly with the operating system of the machine, but indirectly through the virtual machine operating system to interact with the virtual machine will perform the procedure explained to the local system. JVM is the foundation of the Java platform, and the actual machine, it also has its own instruction set, and operating in different regions of memory at run time. Abstract JVM by the operating system and CPU architecture is provided a method of code execution of a platform-independent, i.e., independent of the specific implementation, host hardware, the host operating system. JVM main job is to explain their own set of instructions (i.e., byte code) to the CPU instruction set or system calls corresponding to protect users from being malicious harassment. JVM on top of Java source files are not concerned, it concerned only source files generated by the class files (.class files).

2, JRE: JRE is an acronym for java runtime environment (java runtime environment) is. The light has not let JVM class file is executed, as explained in class when JVM need to call the library lib explanation needed. In JDK installation directory where you can find jre directory, there are two folders bin and lib, where you can think of is in the bin jvm, jvm lib is in the library needed for the work, and while jvm lib and up He called jre. So, after you have written java program is compiled into .class, you can put this package together jre .class file and distributed to friends, so your friends can run you write a program (jre java runtime .class there is. exe). JRE is a larger system of Sun's release, which it will have a JVM. JRE on the specific CPU architectures and operating systems related to running a Java program essential (unless in some other compiler environment compiled into an executable .exe ......), JRE status as a PC, we written Win32 applications need to run the operating system to help us, the same, Java programs must also be written in our JRE to run. 

3, JDK: JDK is an acronym for java development kit (java development kit) is. Each person will first learn java in the machine is equipped with a JDK, then let's look at the JDK installation directory. In the following six folder directory, a source src library archive, and several other declaration file. Among them, the real work when you run java following four folders: bin, include, lib, jre. Now we can see that such a relationship, JDK includes JRE, and JRE included JVM.

bin: the most important is the compiler (javac.exe)

include: the header files and java to interact with the JVM

lib: library      

jre: java runtime environment 

(Note: bin here, lib and jre folders in the bin, lib is different) is developed for the whole JDK java program, and run jre is the only class without compiling function. eclipse, idea and other IDE has its own compiler instead of JDK bin directory that comes with, so when you install you will find that they just ask you to choose jre path ok.

4, JDK, JRE, JVM relationship among summarized as follows:

jdk is used when the JAVA application development tools package, which also has an internal JRE runtime environment JRE. JRE is required to run JAVA runtime environment, that is, if you just run the JAVA program rather than engage in the development, then only install JAVA JRE will be able to run a program that already exists. Internal JDk, JRE contains JAVA virtual machine JVM, JAVA virtual machine contains many internal applications like interpreter and class loader and so on.

Guess you like

Origin www.cnblogs.com/pw126046/p/10993208.html