Steps to debug Java apps in stone-age style:
Run your program with additional switches
java -Xdebug -Xrunjdwp:transport=dt_shmem,server=y,address=MyAppName,suspend=n -cp . test
Run the command line debugger
bin/jdb.exe -connect com.sun.jdi.SharedMemoryAttach:name=MyAppName
Tell the debugger where the sources aresourcepath C:/Cygwin/Home/Chui
Show list of threads, suspend the threads, display call stack, and step through code
$ bin/jdb.exe -connect com.sun.jdi.SharedMemoryAttach:name=MyAppName
Set uncaught java.lang.Throwable
Set deferred uncaught java.lang.Throwable
Initializing jdb [...]