Setting the Classpath

If java is still unable to find your program, you might have to change your CLASSPATH variable. The CLASSPATH variable is where the java program looks to find classes to include when it executes.

In your CLASSPATH setting, make sure that . is included, to indicate the present working directory, as well as any custom directory you make to store class files, such as C:\garage\classes.

In Windows 2000, set the CLASSPATH like this:

1.
Click Start > Settings > Control Panel > System > Advanced Tab > Environment Variables.
2.
Find the one called CLASSPATH (or make it if it doesn't exist) and add the preceding directories to it.
3.
Create this variable as a system variable if it does not exist. Also, make sure that the JAVA_HOME ...

Get Java Garage now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.