«^»
6.4. Compiling from a private directory into one that is visible from the WWW

Although it may be useful to put your .class files into a publically accessible place, you may want to hide the source files. So, if the current directory contains some Java source code and the current directory is inaccessible from the WWW, you can easily arrange for the Java compiler to put the .class files into a different directory (a directory that is accessible from the WWW) by using the d option of the javac command, e.g.:

setenv CLASSPATH .:/users/dcl0bjc/public_html
javac -d /users/dcl0bjc/public_html Date.java
If the file Date.java contains the line:
package uk.ac.dur.dcl0bjc.utils.dateutils;
then the directory /users/dcl0bjc/public_html/uk/ac/dur/dcl0bjc/utils/dateutils will be used by the compiler to store the Date.class file. If need be, it will automatically create any directories that do not exist.