문제

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?

도움이 되었습니까?

해결책

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.

다른 팁

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top