Note: For lab times goto [TA's & Tutors] page.
.gpue_path
(don't miss that dot at the start of that file name) and put
the following line in the file:
setenv CLASSPATH .:/afs/cats.ucsc.edu/users/s/mcdowell/java/publicDon't miss the first two characters of the path which are dot colon. Make sure there is a newline at the end of the line. Put the file in your home directory. The first time you will need to log out and back in, or just type:
source .gpue_path
If your program is throwing an exception and the message gives you a stack trace but it says "compiled code" instead of showing you the line numbers of where you were in your program, trying running your program with the command:
java -Djava.compiler=NONE YourClassFile
To start debugging your program first compile it with "javac -g MyProg.java". Notice the "-g" flag. This causes the compiler to insert debugging information. Then type
jdb MyProg
stop in MyProg:main
run
list
This should show you the first few lines of your program, with an arrow
pointing at the first executable statement in main().
Type help to get a complete list of debugger commands. Here are a few.
xterm & at the
unix prompt in the one xterm you have created.
You can also start up xterm's on curie by clicking the eXceed icon on the tool bar at the bottom (it appears after the first 3 steps above), then clicking Tools/Client Startup/curie.
I must warn you that when we get to chapters 8 and 9, eXceed acts up a bit with graphical Java programs, but the work ok. The eXceed software complains about some fonts, and worse, your Java GUI windows can't be resized and the other eXceed windows get temporarily hung up. The Java program appears (so far) to run ok, and you can still abort it by putting the cursor in the original xterm window and typing control-C.
For more information view Sun's documentation for jdb.