Java's no-frills debugger, jdb, takes debugging input from stdin. But if you're debugging something that gets user input from stdin, it won't ever get any input. So you start the thing you're debugging in another window, telling it to wait for the debugger, then attach the debugger. The incantation for this is verbose and I always have to look it up, so here it is to help me next time.
cmd /c start java -Xrunjdwp:transport=dt_socket,address=5005,server=y,suspend=y SomeJavaClass jdb -connect com.sun.jdi.SocketAttach:hostname=localhost,port=5005I also have a regular set of stuff to put in
jdb.ini
to make jdb less painful. stop at SomeJavaClass:57 exclude java.*,javax.*,sun.*,com.sun.*,junit.*,jdk.* run monitor locals monitor list