Java_home
Variable name: Java_home
Variable Value: E:\java\jdk7
Purpose: Define a variable for use elsewhere
PATH
Variable name: Path
Variable value:%java_home%\bin;%java_home%\jre\bin;
Purpose: To allow the system to identify Java, Javac, JAVAP, and other commands under any path
CLASSPATH
Variable name: CLASSPATH
Variable value:.; %java_home%\lib\dt.jar;%java_home%\lib\tools.jar;
Purpose: Tells the JVM to use or execute the class on what path to facilitate the JVM to load class files. Represents the current path, Tools.jar and Dt.jar as Class library paths
Classpath Detailed
The tools.jar Tool class library (compile and run, etc.) is not related to the underlying class library we use in our program. We notice that the various EXE tools in the variable value Bin directory in path are small in size, typically around 27KB, because they are actually just a layer of code packaging, The implementation of these tools to use the class library are in the Tools.jar, with the compression software to open the Tools.jar, you will find that there are many files and Bin directory exe tool relativity, view figure one. Of course, if Tools.jar's functionality is the only thing, then we don't have to add it to the CLASSPATH variable, because the tools in the Bin directory can make calls to these libraries themselves, so Tools.jar should have other features. In the inside also can see the applet and RMI and other related files, so tools.jar should be a remote call, such as the necessary jar package.
Other functions of Tools.jar can be viewed in other information. Dt.jar run Environment Class library, mainly swing package, which can be seen by opening Dt.jar with compression software.
If a swing package is not used at development time, you can not add Dt.jar to the CLASSPATH variable. The class library in Classpath is loaded by application ClassLoader or our custom ClassLoader, which of course cannot include the underlying class library, and if the underlying class library is included, load the underlying class with two different custom ClassLoader.
The base class that it gets is not unique, so the security of the Java class is not guaranteed. Basic class libraries and extended class libraries Rt.jar basic class libraries are classes that begin with all the import java.*, in the%java_home%\jre\lib directory (such as Rt.jar, Resource.jar), the class loading mechanism mentions that the class in the directory is represented by the
Bootstrap ClassLoader automatically loads, and the Pro delegation model guarantees that the underlying class library will only be loaded by the Bootstrap ClassLoader, which guarantees the uniqueness of the underlying class.
The Extended class library is a class that begins with all of the import javax.*, and in the%java_home%\jre\lib\ext directory, the class under that directory is automatically loaded by the extension ClassLoader, and does not need to be specified. Rt.jar default is in the root classloader loading path, placed in Claspath is superfluous