124

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?

0

5 Answers 5

191

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

enter image description here

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

Java -> Show static variables

enter image description here

Note: You do not have to restart Eclipse.

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

1 Comment

Life saver! Thank you. In current versions of Eclipse it's become a three-dot-menu, not an arrow anymore.
20

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

1 Comment

That helps to see the value. But you cannot edit/change it here.
5

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

Comments

2

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

Comments

1

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

Comments

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.