Trying to use jdb erases source, sort of


#1

Given the absence of debug support for Java (which amazes me, since it has a debug interface already defined), I tried to use jdb. So I go to the bash window, and type “jdb”. It tells me the debugger is initializing, and I get the jdb prompt. So I type
stop in HelloWorld.main

but at that point, the entire text of the simple HelloWorld.java file disappears, and the file appears to be empty. But if I exit the tab, and re-open the shared workspace, and the source code is there. But once I’ve set the breakpoint, and try to run, I get the error that HelloWorld.main cannot be found, which is not surprising because the source file contents are gone. If I repeat closing the tab and reopening the shared workspace, the source comes back.

I have no idea why this is happening, although having native debugging support would obviate the need to run some other debugger.

Is there a recommended debugger to use? I have always programmed in Eclipse, so I have never needed to use any other debugger because it has built-in debug support.


#2

I am now getting weirder behavior. When I open the shared workspace, for some reason it compiles and runs the program, which prints out some results. But the file appears to be empty. If I click “Run” again, the program runs as expected, but the file still appears to be empty. No idea what is going on here. Suggestions?