Secrets behind Java in-depth exploration of Java Virtual Machine 01

Source: Internet
Author: User

My goal is to become an enterprise-level architect. To become a qualified architect, there are still many things to learn. Now has recently learned about Java virtual machines. If the mainstream Java frameworks are moves, a deep understanding of Java virtual machines is the so-called internal practice, that is, internal work. The internal force in martial arts novels is very useful. Let's start with two questions. You can also think about it:
1. Why are two sets of JRE displayed after JDK is installed? (What? You don't know. You're out)
2. There are two jre in the system. who decides which JRE to use?

Many beginners are not very clear about these two questions, including some people who have some development experience for a few years. I will explain it below:
1. Why are two sets of JRE displayed after JDK is installed? (The directory structure after jdk6.0 is installed)

-Java
-Jdk1.6.0 _ 23
Bin
+ Demo
+ Include
+ JRE
+ Lib
+ Sample
+ Jre6

See no. There are two red JRE. The second JRE provides an environment for running Java programs. The first JRE supports the environment run by Java development tools, such as javac and Java commands, these are all written in Java. If only the second jrecan only support Java program running, but cannot support development, the binary directory of the second jredoes not have the javac.exe command. To put it simply, two JRE are required for program development.

2. There are two jre in the system. who decides which JRE to use?
This difficult task is stored in java.exe. When you input the java.exe command to execute a Java program, it will follow the following method:
Find the appropriate JRE. (What, how can I know? Haha, I also heard about it. The book Java deep adventure says, I suggest it .)

1. First, check whether your directory contains JRE (JVM. dll in Windows is a Java Virtual Machine)
2. Check whether JRE exists in the parent directory.
3. Query System Configuration (view registry items)

Therefore, we can see that by changing the JRE used by the program, we can control the program's capabilities and behavior.

Refer to the books Java deep adventure and IBM \ sun virtual machine architecture White Paper.

Source www.boobooke.com/bbs-> J2EE area-> Blue Mountains work-secrets behind Java (Summary)

Related Article

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.