Reference:

JUnit debugging in Ant, Gradle, Maven


> I want a JVM on a printer - by someone > > “Debugging is twice as hard as writing the code > in the first place. Therefore, if you write the code > as cleverly as possible, you are, by definition, not > smart enough to debug it.” - Brian Kernighan

jdb

It was different coming from gdb and trying to wrap my head around the attaching debugger to all the different build system in java. I find it best to automate these in a bash script when you have it setup the way you want it. You can see all the examples Github and Junit Tutorial.

A simple example of jdb would be javac -g Test.java and then jdb Test, set breakpoints and run. All is well for a simple hello world program.

TIP. You can set breakpoints in a jdb.ini file.