Home Segments Top Top Previous Next

647: Mainline

The components of package names always correspond to the final components of the path that specifies the directory in which the corresponding compilation units reside. The initial components of the path are taken from the value of CLASSPATH, an operating-system environment variable. Suppose, for example, that you are working in a Windows environment, that the value of the CLASSPATH environment variable includes the d:\phw path, and that the package name for your program is onto.java.entertainment. Then, the compilation units of the package reside in the d:\phw\onto\java\entertainment directory:

  *-- From the CLASSPATH variable 
  |  
  |      *-- From the package name 
  v      v 
------ ----------------------- 
d:\phw\onto\java\entertainment 

If you are working in a Unix environment, the value of the CLASSPATH environment variable includes /usr/phw, and the package name is onto.java.entertainment, then the compilation units of the package are in the /usr/phw/onto/java/entertainment directory.