简体   繁体   中英

Eclipse Variables View

I am new to Java and using Eclipse IDE Photon Release version 4.8.0.
I cannot display variables.

I have tried the followings in accordance with previous online Q&As only to fail:
(1) Select a variable -> right click -> select inspection
* It didn't work because inspection is not on the right click menu.

(2) Window -> Perspective -> Reset perspective
* It didn't work.

(3) Window -> Show view -> Other -> search "variable" and open "Variable View"
* It opened the Variable View window, but nothing is displayed. Changing layout didn't help.

How can I display information about the variables? I would like to see their values step by step when debugging a programme.

U need to enter into debug mode to see the results line by line There are two aspects:

1) Putting Breakpoint

2) Running in debug mode

Double click on any line it will add a breakpoint on that line, now click on green bug icon(debug)/debug as

it will run the application in debug mode

It will stop at that line and will ask to switch in debug perspective, select yes

[imp] now if u can't see variable view select

window->show view->variable

here u will see all the variables in scope, press F6 and it will proceed line by line debugging there u will be able to find the variable value at each line

  1. Put breakpoints where you want the debugger to stop and inspect variable values.(Double click on left side of the line to put a break-point)

  2. Run your java code in debug mode.

  3. Eclipse will open debug perspective automatically for you when it stops at the break-point.

  4. In this window you can see the variable values and other properties in 'Variables' view. (Mostly present on the top right in Debug perspective)

Enter in debug mode and enable the variable view using the (3) option. When you are stopped at debug, if the view of variables is empty, close it, and now, without stopping the application, perform the reset using step (2). Now try to enable again the view using the step (3).

I had the same problem. The solution was as follows.

eclipse menu -> Project -> Clean -> Clean all projects

After that, I did restart eclipse IDE. It works for me.

And you should check your administrator privileges. Run javaw.exe, java.exe as administrator.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM