Modify/view static variables while debugging in Eclipse

EclipseDebuggingVariablesStatic

Eclipse Problem Overview


As per the question. In the debug view, there's the Variables frame. It shows all the values of member variables of the current object, and all of the local variables, but it doesn't show any static variables of the object's class.

How do I get to these?

Some googling has suggested I press the button on the toolbar, but there's nothing on the Variables frame's toolbar except "Show Type Names" "Logical Structure" and "Collapse All" (Eclipse 3.4.2).

Any advice?

Eclipse Solutions


Solution 1 - Eclipse

In the Debug Variables view their is a arrow button in the right of the view. the tooltip of this button is Menu.

When you click this button a drop down menu is shown where you can select

Java -> Show static variables

Note: You do not have to restart Eclipse.

enter image description here

Solution 2 - Eclipse

Simply put your mouse cursor over the static variable in the code and you will see the assigned value.

Solution 3 - Eclipse

You can view static variable and also edit during runtime. Click on small arrow pointing downword. see below image enter image description here

Solution 4 - Eclipse

Window -> Show View -> Other -> Debug -> Expressions -> Right Click on Window -> Add Watch Expression... -> Enter the name of the variable you want to see

Solution 5 - Eclipse

You might also try writing the expression e.g. self::$value in the watch window

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionmccccleanView Question on Stackoverflow
Solution 1 - EclipseMarkus LausbergView Answer on Stackoverflow
Solution 2 - EclipseBhushan BhangaleView Answer on Stackoverflow
Solution 3 - Eclipsezishan payaView Answer on Stackoverflow
Solution 4 - EclipseIonut AnghelcoviciView Answer on Stackoverflow
Solution 5 - EclipsecodeDisasterView Answer on Stackoverflow