
| Course Home | Syllabus | Lectures | Example Programs | Exercise Solns | CoreJava Progs Documentation |
Gen'l Docs | Java 2 APIs | Java Glossary | Term Proj Info |
/usr/jdk1.2.2/.
%java -versionwhich should produce the response
java version "1.2.2" Classic VM (build JDK-1.2.2-001, green threads, sunwjit)
If you do not get this response, you need to add /usr/jdk1.2.2/bin (before /usr/bin where an older version of Java resides) to your Unix path variable. If you do not know how to do this, see the TA, Sivaram Burra, or a consultant in the basement of Smith Hall.
Note that the system always appends the location of the system classes onto the end of the class path unless using the -classpath option to specify a path.
To set CLASSPATH, put the following lines in the file   ~/.localenv   or   ~/.cshrc.
# Add for Java
setenv CISC370HOME /home/base/usrc/35/13772/Class/CISC370-00S
setenv CLASSPATH .:$CISC370HOME/CoreJavaBook:$CISC370HOME/example-progs
Java is very strict on file names. There can be only one public class per file and the source file name must be ClassName.java (case is important). You must make sure the file name is correct.
The compiler may generate several .class files - one for each class in your source file. The bytecode of a class will be in the file ClassName.class. Anonymous inner classes will have the name ClassName$count.class where ClassName is the name of the parent class and count is an integer.
When you begin a project it is best to make a new directory and put all your related .java files in this directory with the correct names. To recompile just use the command "javac *.java." When you are done you may want to consider packaging all your class files, data files, etc., into one java archive using the jar command. This is also easier if you have your project organized in one directory.
The html pages come from the JavaSoft web site.
Back to the
CISC 370 homepage.
This page has been accessed
times since 7 Feb 2000.
Corrections, suggestions and comments to caviness@cis.udel.edu
Last updated 10 Feb 2000.
Copyright
2000 B. F. Caviness