Java BASICS (2) Composition of the Java language

Source: Internet
Author: User

In the previous blog post, the basics of Java practice (I) Java language features we introduced several features of the Java language. Today we will introduce the composition of the Java language.

The so-called Java composition mainly refers to the composition of the Java Runtime Environment, from the peripheral to the core is the Java Development Kit JDK (Java Develop Tookit), Java Runtime Environment JRE (Java Runtime Environment) java Virtual Machine (JVM ).

JDK jdkmainly refers to some java language development kit (javac.exe?jar.exe=javadoc.exe and so on). In addition, JDK also contains the complete JRE. After installing JDK, you will find that JDK contains two sets of JRE, one under the Jdk \ jre directory and the other under the Java directory.

Relatively speaking, the second set has fewer Server-side Java virtual machines and several other files. There is no difference between the two, but we still need to install the second set of JRE when installing JDK, this is because the division of labor between the two sets of JRE is different. For Java programmers, when developing Java programs, they will first find the JRE under the parent directory of "java, javac, and so on, therefore, the first set of JRE will be executed, but when a general external program is executed, the second set of JRE will be executed.

JRE is the basis for running Java. It mainly provides various APIs for running Java. To run a Java program, you must install JRE. This is because, when interpreting. class, JVM needs to call the lib class library under the JRE required for interpreting. class.

JVM is a fictitious computer. It is implemented by simulating various functions of the computer on the actual computer. JVM itself has a relatively complete hardware computer architecture, including a set of bytecode instruction sets, a set of registers, a stack, a garbage collection heap, and a storage zone. With JVM implementation, Java programs can run in any operating system to achieve platform independence.

One JVM has become an important part of Java instant compiler JIT (Just-in-time compiler). It can convert Java bytecode into processor instructions, at the same time, this process is used to speed up Java program execution time.


Relationship between the three

After learning about the concepts and composition of JDK, JRE, and JVM, we can clearly understand how the Java language completes the entire process of writing, compiling, and execution.

First, the compiled source code will be handed over to JDK and compiled into bytecode through the JDK compiler, that is, the common. class file. When a. class file needs to be run, it is converted to a platform-independent machine instruction through JIT in JVM. These machine commands are executed in JRE. The entire process is shown in:




This blog introduces the components and functions of the Java language throughout its operation, the purpose of understanding this is to think about the architecture and design of the Java language and why Java is such an architecture and design, in this way, we can fully learn from the development and design. For beginners of Java, this part should not be further studied. It is good to simply understand it. I believe that I will learn it again in the future.


Next, we will continue to explain other content in the Java language.

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.