Add the following to the end of your ~/.cshrc file:
# Java env variables
set path=($site_path /usr/class/cs108/bin . ~/bin)
# Set the class path for cs108 java files
setenv CLASSPATH .:/usr/class/cs108/jar/junit.jar
Then execute the following line to reload your ~/.cshrc file
source ~/.cshrc
Execute the following to ensure your path is set:
printenv CLASSPATH
It should say:
.:/usr/class/cs108/jar/junit.jar
To compile all of your files, execute:
javac -g *.java
If you want to run a class with a main function:
# Note that we do not include the ".class" extension
java <class name>
E.g., if I have a class called Tetris.class, that contains my main() function, then I would execute:
java Tetris
If you want to run a JUnit test with the Swing Graphical User Interface (remember, don't include the ".class" extension):
java junit.swingui.TestRunner <test class>
If you want to run a test in text-only console mode:
java junit.textui.TestRunner <test class>