This article is a mirror article of machine translation, please click here to jump to the original article.

View: 19111|Reply: 0

[Source] JDK, JRE, JVM differences and connections

[Copy link]
Posted on 4/7/2015 4:08:49 PM | | | |
Many friends may be like me who have been using JAVA for a long time, but the connection and difference between JDK, JRE, and JVM have always been vague.
    Today I will write this article to sort out the relationship between the three.

    JDK : Java Development ToolKit. The JDK is the core of the entire JAVA, including the Java Runtime Envirnment, a bunch of Java tools (javac/java/jdb, etc.), and Java-based libraries (i.e., Java APIs include rt.jar).
    The most mainstream JDK is the JDK released by Sun, in addition to Sun, there are many companies and organizations that have developed their own JDK, such as foreign IBM companies have developed their own JDK, domestic Taobao has also developed its own JDK, various organizations have developed their own JDK in order to get some improvement in some aspects, to adapt to their own needs, such as IBM's JDK is said to be much more efficient than SUN's JDK. But in any case, we still need to master the basic Sun JDK first.
    There are three versions of the JDK:
J2SE, standard edition, standard edition, is a version we usually use J2EE, enterpsise edtion, enterprise edition, using this JDK to develop J2EE applications J2ME, micro edtion, mainly used for java applications on mobile devices, embedded devices

    We often use JDK to refer to Java API, Java API is Java's application programming interface, in fact, it is some java classes written by our predecessors, including some important language structures and basic graphics, network and file I/O, etc., we call these classes written by our predecessors in our own programs, as a basis for our own development. Of course, there are more and more third-party libraries with better performance or more powerful features at our disposal.

    JRE: Java Runtime Enviromental. In other words, all Java programs must be under the JRE to run. Includes JVM and JAVA core libraries and supporting files. Compared to the JDK, it does not include development tools - compilers, debuggers, and other tools.

    JVM: Java Virtual Mechinal (JAVA Virtual Machine). The JVM is part of the JRE, which is a fictional computer that is implemented by simulating various computer functions on a real computer. JVM has its own complete hardware architecture, such as processors, stacks, registers, etc., and also has a corresponding instruction system. The main job of the JVM is to interpret its own instruction set (i.e., bytecode) and map it to the local CPU's instruction set or the OS's system calls. The Java language runs cross-platform, which is actually a different operating system, using different JVM mapping rules to make it independent of the operating system and complete cross-platform. The JVM doesn't care about the upper-level Java source files, it only cares about the class files generated by the source files. The class file consists of a JVM instruction set, a symbol table, and some supplementary information.
The following figure gives a good overview of the relationship between JDK, JRE, and JVM:



    The actual situation of our development is that after we develop our own JAVA program using the JDK (call JAVA API), we compile our text java files into JAVA bytecode through the compiler (javac) in the JDK, run these JAVA bytecodes on the JRE, the JVM parses these bytecodes, and map them to the CPU instruction set or the system calls of the OS.





Previous:java.math.BigDecimal class
Next:Basic data types built into Java
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com