1

I am working on Eclipse more than 2 years, but suddenly a point has come to mind that:

Why Java APIs Classes does not show variables value while debugging in Eclipse 3.x??

When debug control is on my classes, its properly show all variables value but when control goes to Java API Classes, it doesn't show any value.

When I use the shortcut to display the variable value..a error dialog displays with message "Variable cannot be resolved".

What is this indication? Why not Java show all variables value at any depth of debugging?

Thanks in Advance.

1 Answer 1

4

It's because the Java API classes are not compiled with debug symbols. Nothing you can really do about that.

Sign up to request clarification or add additional context in comments.

5 Comments

Ok. But Is this not a bug in Java API? B'coz sometimes variable's values in the inner most Class helps to identify the exact problem in user's code e.g. char position in a String.
No, not a bug in Java. You can see for yourself if you compile your code without the debug flag, it will look the same as the Java API code in the debugger.
Fine. Its means we can say That ClassLoader deos not load any Java APIs classes while debugging. As I know before running/debugging the code its loads the users classes into memory, hence the variables values can be seen at that time.
Not quite, the ClassLoader loads the classes like any other classes. The differences is the classes for the Java API don't have the additional debugging information that allows you to see argument names or local variable names.
Thanks @Francis. This will help me to understand the Java more closely.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.