Why Eclipse doesn't show local variables values when I debug class file from JDK?

gstackoverflow picture gstackoverflow · Apr 14, 2014 · Viewed 24.8k times · Source

I want to debug .class files. For example some from the JDK. I downloaded the sources and attached them.

public File[] listFiles(FilenameFilter paramFilenameFilter)
{
   String[] arrayOfString = list(); // now we here
   if (arrayOfString == null) return null;
   ....
}

Then I type F6 and move to the next line. After that, I try to watch the value of arrayOfString but I see the following:

Expression view:

Is it normal a situation? Is there a way to debug?

Update 1:

enter image description here


Update 2:

enter image description here

Update 3:

enter image description here

Answer

Absurd-Mind picture Absurd-Mind · Apr 14, 2014

The problem is that the source/class files from the JDK are compiled without debug information and therefore eclipse can't inspect these vars. See this answer for more information.

To solve your problem you need to get a different rt.jar or compile it yourself