This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes IDEs, Version Control and other tools and the fly likes Debug Help Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Engineering » IDEs, Version Control and other tools
Bookmark "Debug Help" Watch "Debug Help" New topic
Author

Debug Help

Harikrishna Gorrepati
Ranch Hand

Joined: Sep 23, 2010
Posts: 422
Hi, In the debug mode, I am not able to see class level variables(s) under Debug variables section. Any reason for that ?

Please see this screenshot


[Thumbnail for debug.png]



OCPJP 6.0-81% | Preparing for OCWCD
http://www.certpal.com/blogs/cert-articles | http://sites.google.com/site/mostlyjava/scwcd |
Marco Ehrentreich
best scout
Bartender

Joined: Mar 07, 2007
Posts: 1280

Hi Harikrishna,

in the variables view in Eclipse you can click on the "menu icon" (this is the arrow downwards) and there you choose "Java -> Show Static Variables". This will do the trick

Marco
Harikrishna Gorrepati
Ranch Hand

Joined: Sep 23, 2010
Posts: 422
Thanks Marco. This will show only static variables..Do you know how we can see instance variables as well.
Marco Ehrentreich
best scout
Bartender

Joined: Mar 07, 2007
Posts: 1280

1.) The "instanceVariable" in your screenshot is NOT an instance variable. It's called a local variable because you declared it inside a method. So the name is misleading. Local variables are visible by default in the variables view.

2.) Real instance variables would be visible in the debugger by default when you would open the "this" field in the debug view. But because you are only using the static main() method there is no instance of a class involved and therefore there is no "this" and no instance variables. You will need something more "complex" in order to see more information in the variables view

Marco
Harikrishna Gorrepati
Ranch Hand

Joined: Sep 23, 2010
Posts: 422
Excellent..Thanks Marco
Ankit Garg
Sheriff

Joined: Aug 03, 2008
Posts: 9291
    
  17

Nothing to do with SCJP, moving to IDEs forum...


SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
 
Consider Paul's rocket mass heater.
 
subject: Debug Help
 
Similar Threads
DriverManager.getConnection() not working in runtime but working fine in debug mode of Eclipse
Variables are not shown in Eclipse debugger Variables view.
Eclipse Debugging
Session Advice
catalina.out -> amok