This page is generally correct but needs some work before it will be accessible to a large number of CS5 students. If you've had experience using a debugger in the past, the page might be fine as is.
The Integrated Development Environments (IDEs) we use in this class either don't handle the debugger at all (JCreator) or don't handle it when input from the keyboard is needed (Xcode). Since we only write console applications in CS5, if you wish to use the debugger on a program that receives standard input, some magic is needed.
Open two command windows:
Note: If you're running this from your dorm computer and it is a PC, you'll need to make sure that your path is properly set (as described here).
Debugging the program:
javac -g CS5App.java
java -Xdebug -Xrunjdwp:transport=dt_socket,server=y,address=4571 CS5AppThis window provides your program with standard I/O.
jdb -connect com.sun.jdi.SocketAttach:hostname=localhost,port=4571This window provides your access with the debugger, which can then be used to step through your code and view its behavior in a variety of ways.
Good Luck, Have Fun, and ask questions if you have any!