# Summary Class Path is the path to the Java execution period to search for categories and other resources. Class Search Path (usually known to compare this abbreviation name this) can be used to use -classpath when the SDK tool is called, or sets the ClassPath environment variable. It is recommended to use the -classpath option because you can set up separately for each application without affecting other applications, and there will be no other applications to change this value. C:> sdktool -classpath classpath1; classpath2 ...- or -c:> set classpath = classpath1; classpath2 ... on this: SDKTool: is a command column tool program, like Java, Javac or Javadoc.classpath1; ClassPath2: ClassPath Points .jar, .zip, or .Class file Class Path, each classpath should end with a file name or directory name (which is related to the ClassPath you want to set). * For a .jar or .zip file including .class, Class Path is to end with the name of the .zip or .jar file. * For an unnamed Package, the class path is to end with the directory of all .class files. * For a named Package, Class Path is to end with the directory name including "The First Package Name of the Full Package Name). Multiple path projects should be seized in a semicolon, using the set command, the important thing is that the equal sign cannot be blank. Preset Class Path is current directory, setting ClassPath variables or using the -classpath command option to overwrite this preset, so if you want to include the current directory in the current search path, you must include "" " ". That is, it is not a directory that is not the ClassPath of the file file (.zip or .java) will be ignored. # Description Class Path tells the SDK tool program to find where the third element (third-part) defined by the user, is also part of the non-Java extension kit or non-Java platform. When you use the Javac compiler to compile categories, you need to use Class Path to find any of the required suits - the preset is current directory to facilitate finding these categories. Java2 SDK, JVM and other SDK tools find the desired Classes by searching the Java platform, Classes, other extensions, classes, in this order (to understand the details of the search policy, see how to find Classes, How classes Are Found), the category library used by most applications can utilize the extensions mechanism, where you load a category of current directory or other subdirectories and they are not extended in the rendering kit, you What you want is to set Class Path. If you upgrade from the old version of the SDK, you may include the ClassPath settings that have no longer used in your boot settings, you must remove these non-specific applications, like classes.zip, some use to Java virtual The third component of the machine may change your ClassPath environment variable to include the program library they use, and these settings can be retained.
When you ask the JVM or other SDK tool program, you can change the Class Path when you use the Java tool program, or specify using the ClassPath environment variable. It is recommended to use the -classpath option to be better than setting the ClassPath environment variable because you can set separately for each application, without affecting other applications, and other applications do not change this value. Classes can be stored in the directory (data clip) or in the file file, the Classes of the Java platform is stored in RT.jar, to understand the details of the file file or how the Class Path is working, please see "Learn about the Class Path and Package Names later." Important, Note: Some older version of JDK software includes
Changing the start setting: If the classpath is set to the system startup, the setting place will depend on the job system you are using: Homework system method: * Windows 95 and 98 Check the SET instruction in AutoExec.Bat * Others (Windows NT, Windows 2000, ....) Use the system tools in the console to set the classpath variable # Understand the Class Path and the Package Name Java's Classes is organized as Packages, which corresponds to the directory structure of the archive system, but unlike archive systems, whenever When you specify a package name, you specify the entire package name instead of a part name, for example, Java.awt.Button's Package name is specified using java.awt. For example, suppose you want a Java execution environment to find a class called Cool.class in the package name utility.myApp, if the path to the directory is C: / java / myclasses / utility / myApp, you want to set the Class Path to include C : / java / myclasses. To perform this app, you can use the following JVM instruction: c:> java -classpath c: / java / myclasses utility.myapp.cool When the application is executed, the JVM uses the Class Path setting to find any other defined Categories in Utility.myApp Package (it is used by Cool Categories). Note that the entire Package name specified in the command, for example, setting Class Path includes C: / Java / MyClasses / Utility and uses instruction java myapp.cool, which does not find Class. (You may think about what defines a Class's package name, the answer is part of the Class, and cannot be modified unless you re-compile it.) Note: An interesting result of a package specified mechanism is the same package Partial files can exist in different directories. For each class, the package name will be the same, but the path to each file will begin with different directories in Class Path.