The difference between JDK,JRE,JVM

Source: Internet
Author: User

The JDK contains the JRE, and the JRE contains the JVM.

In general, the JDK is for the development of Java programs, while the JRE is only capable of running class without compiling.

650) this.width=650; "Src=" Http://s3.51cto.com/wyfs02/M00/8C/63/wKioL1hrSC_gfKI2AAAgudldBuQ001.png-wh_500x0-wm_3 -wmp_4-s_3882192813.png "title=" 091548130039804.png "alt=" Wkiol1hrsc_gfki2aaagudldbuq001.png-wh_50 "/>

JDK and JRE

Typically, when you install the JDK, you will be asked to choose whether to install a public JRE. If a public JRE is installed, then there will be two sets of JRE in the computer.

This is because the tools in the JDK are also written in Java code, so to use these tools requires JRE support, in order to ensure the relative independence of the JDK, so the JDK has installed a set of private JRE. It is mainly used to run debugging tools such as compiling.

So if there is more than one JRE in a computer, how should I choose? The lookup order is this:

    1. Can I find the Java.dll file in the Java.exe directory?

    2. Can I find the JRE directory in Java.exe's parent directory?

    3. Can I see which JRE the key value of CurrentVersion is pointing to in the registry Hkey_local_machine\software\javasoft\java Runtime environment\


For example, if a public JRE is installed, he will record the version and path information in the registry and copy the Java.exe to the Winsows/system32 directory. Because the directory has been added to environment variables, you can use Java commands without adding additional environment variables.

Then execute the Java command.

First he will go to the Winsows/system32 directory to find out if there is a Java.dll file, do not find to continue to the parent directory to find out if there is a JRE directory, and then find it in the registry.

If Java_home is configured, first locate the Java.dll file in the Java_home/bin directory, and then load the Java.dll file to the parent directory after finding the JRE directory found.


JRE and JVM

JVM It is the most central part of the entire Java implementation cross-platform that is primarily used to execute class files, the JVM cannot take care of class execution alone, and the JVM needs to invoke the class library lib that is required to interpret class. In the JRE directory below the JDK there are two folders Bin and Lib, where it can be thought that the bin is the jvm,lib in the JVM is required to work the class library, and the JVM and Lib are called the JRE. Jvm+lib=jre



The difference between JDK,JRE,JVM

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.