File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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
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: 1282

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: 1282

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: 9304
    
  17

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


SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
 
 
subject: Debug Help