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)