views:

36

answers:

2

I'm currently integrating some new classes into an existing application. I have a JDialog which, when clicked, throws a number of runtime exceptions.

I'm new to Java debugging - why would all of these Swing/AWT library functions be 'unavailable'?

SO forbids me from posting images, so here's a link to a capture of the eclipse debugger:

http://i.imgur.com/jDWEe.png

Why would these methods be unavailable?

+2  A: 

Those classes are available, they have been compiled without line numbers so the eclipse debugger is just telling you that it doesn't know which line of JButton from the original source etc. it is currently on. See the various javac -g options. Line number information will not be terribly helpful in debugging, but within your own code this will help track down causes of stack traces and of course helps the debugger know where it is up to.

krock
Ah, I had assumed that the 'Debug' perspective automatically built with those compile flags.
Merto
+1  A: 

The "not available" indicates that the classes were compiled without debug information, i.e. using the -g:none switch with javac. Since those are Standard API classes, I suspect that your eclipse project is configured to use the JRE System Library from a JRE installation rather than a JDK. You can change that in the project properties (right click on project -> Properties -> Java Build Path -> Libraries); you may have to install a JDK first.

Michael Borgwardt
I had to point eclipse to the JDK as you said, and now I have more debugging information. Thanks.
Merto