A final detail related to Java programming involves setting the CLASSPATH environment variable to tell the Java interpreter where to find classes.
Recall from a previous section the installation directory structure of Sun's JDK:
/usr/java/j2sdk1.4.1/ bin/ binaries (java, javac, etc.) jre/lib/ bootstrap classes ext/ extension classesBy default, the Java interpreter looks for classes in the following order:
the bootstrap classes
extension classes
user classes defined in one of a number of ways
Beyond the standard bootstrap classes and extension classes, the user can define one or more locations for user classes in a number of ways, as shown in this list which is in order of increasing priority:
a default user class path of "."
the CLASSPATH environment variable
the Java interpreter -cp or -classpath options
the -jar for identifying a single .jar file
If you need any help beyond what's in this section, it's time to pick up a good book on Java.