Directions for Downloading Sample Programs
Data Structures and Other Objects Using Java (Third Edition)
by
Michael Main
ISBN 0-321-37525-4
- Download the dsjava.zip file by RIGHT
clicking and choosing Save Target As. You may download this
file to any directory, and then unzip it.
For example, I unzipped
mine in a folder called \JavaBook. You should find these
subfolders after
unzipping:
applications
applets
docs
edu
-
Your own programs do
not need to be in same folder as the samples,
but when you compile (with the
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 ThrottleDemonstration
These 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.
Data Structures and Other Objects Using Java
Michael Main
(main@colorado.edu)