CLASSPATH
CLASSPATH is an environment variable which tells the Java compiler and the JVM where to look for Java class files.
In Java 1.2 and later, the CLASSPATH variable is less critical because Java knows how to find the default classes and because Java loads classes from the current directory by default.
If you do not want to use an environment variable, you can use the -classpath argument to the Java compiler or the JVM as such:
javac -classpath . JavaProg
To add a jar file to your CLASSPATH, include the entire pathname of the jar file — including the filename.
Setting the CLASSPATH in Microsoft Windows XP
Unlike Unix, setting environment variables in Windows can be somewhat difficult.
To configure a persistent CLASSPATH under Windows XP:
- Click the Start Button
- Select the Control Panel
- Click Switch to Classic View
- Click the System button
- Select the Advanced tab
- Click the Environment Variables button
- Click the New button to create a CLASSPATH or the Edit button to edit an existing CLASSPATH
- Enter CLASSPATH as the variable name
- Enter the list of directories or jar files in your CLASSPATH as the variable value, using a semicolon to separate entries in your list
- Click OK
- Click OK
- Click OK
Comments - No Responses to “CLASSPATH”
Sorry but comments are closed at this time.