Question

I am working on a web project and Debug options like 'Watch' and 'Inspect' are not working in My eclipse. In both cases it says variable cannot be resolved.

Environment

IDE: My Eclipse Version: 8.6.1 Build id: 8.6.1-20101117

OS Windows 7 Version 6.1 (Build 7600)

Java SE Runtime Environment (build 1.6.0_16-b01)

Interesting thing is these options works fine on other Web and Standalone projects

See screen for error details. Has anyone encountered such a problem? Kindly help how to resolve this

enter image description here

enter image description here

Was it helpful?

Solution

I have checked the Java >> Compiler options from Windows >> Preferences menu and option of 'Add variable attribute to generated class file' was unchecked. I have enable that option and this resolves the issue. Now 'Watch' and 'Inspect' are working fine in my particular web project. See screen shot

enter image description here

I am not sure why this why enabling this option is necessary because in all other projects (in same workspace) debugging is working fine with this option disabled. Can anyone explain?

OTHER TIPS

The execution of your code has not reach the point where your variable "value" is instanciated. Press F6 twice (to execute the next 2 lines) and you will see your variable's value.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top