The jdb Java debugger, which comes with the Java package, is very, very primitive. It not only lacks powerful commands, but it does not even have any means of reducing the number of keystrokes one uses.
However, the latter problem can be resolved by using the ddd GUI (use at least version 3.3 if possible), in which case jdb is fairly usable. Instead of repeatedly typing "next", you can repeatedly click on the Next button, etc. Invoke ddd as follows:
ddd --jdb <class name>.
You'll have to load the .java file yourself, clicking on File then on Open Source.
First, make sure that the program has been compiled using the -g option of javac. Then type
jdb <class name>
There are two forms:
stop at <class name>:<line number>
stop in <class name>.<method name>
First, set a breakpoint at main(). Then
run <class name> <command-line arguments>
Make sure you don't forget the class name; otherwise you will get a "URLClassLoader not found" error message.
When you then use the "list" command, breakpoints will show up with arrow marks.
The step, next and cont commands work like their counterparts in gdb.
list <classname>:<line number>
Use the "print" command. A drawback is that static variables are not accessible.
Use the "quit" command.
Click on New Class to make a new class file. The editor window will pop up, and you can start typing.