applications
applets
docs
edu
javac
command) and run (with the java
command) you must tell both commands where to
find the classes that you are importing. For example, you can compile and run
ThrottleDemonstration.java
from Figure 2.3 with these commands (assuming that
ThrottleDemonstration.java
is in the current folder):
javac -classpath .;\JavaBook ThrottleDemonstration.java java -classpath .;\JavaBook ThrottleDemonstrationThese commands give extra information about the classpath, telling the
javac
and java
commands to look first in
the current folder (which is represented by the
period before the semi-colon) and in the folder called \JavaBook
).
If you are using some programming environment that does not use the
javac
and
java
commands directly, then you'll need to find out how that environment goes
about setting the classpath variables.