简体   繁体   中英

Can't see variables when debugging Java code in Eclipse

I have very annoying problem:

When debugging

String tm1 = "1";
String tm2 = "";
tm1 = tm2; 

Only variable tm2 is showing in Variables view in debugger mode, but not tm1. I assume because I used tm2 value in 3rd line. If I comment 3rd line, tm2 will disappear too.

Why?

I asume there is some optimization in place and Eclipse concludes that my variable is not used so it doesn't want to show it. Is there a way to turn this off?

Also, I could swear, before in debugger, if I would hover mouse over variable, little popup would show with variable value. It's not the case any more.

Any help is appreciated, Thanks

Which variable you did not use in your program or code that variable does not view in variable view in debugger mode. Here you used variable tm2 to replace value of tm1. So tm2 is display in variable view in debugger mode and tm1 not.

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