During debugging, i need to inspect variables inside JDK, say the class of a swing control like JTextField, JEditorPane, or whatsoever.
The debugger steps into these classes code, but when moving the mouse pointer over a local variable, it gives the message “xxx is not a known variable in the current context“.
I’ve certainly a wrong debugging-configuration entry, but I don’t guess which one :-).
(My NetBeans version is 6.9 but probably this issue is not version-related)
JRE classes are compiled with debugging info off therefore you won’t see any local variables while stepping through the source. This is done for performance/size reasons but you can recompile the JRE classes if you need to see the local variables while debugging.
See this thread on Javalobby for info on recompiling the JRE classes with debug info included.
Follow Up: One way to use your alternative JDK is to make a copy of your “regular” JDK and put the modified rt.jar inside the copy, then you can add a Java Platform to NetBeans and use the modified JDK for development. To add another Java Platform to NetBeans, click
Tools > Java Platformsmenu item then click theAdd Platform...button and browse to your modified JDK folder and give it a name likeJDK 6 With Debug Symbols.You will need to change the Java Platform that your project uses by right clicking your project and choose
Properties > Librariesthen use theJava Platformcombo box to choose your modified JDK.