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.
For more information view Sun's documentation for jdb.