'is not a known variable in the current context

i have big problem with debugging Java Project on Netbeans [6.9 and 7] , in debugging mode when put mouse cursor on variable get this message : ... is not a known variable in the current context. do you have idea for solve this problem on netbeans ?



Solution 1:[1]

It means that the code you have executed so far has not defined the variable yet. Press F7 a couple more times until the code defining the variable is executed.

Solution 2:[2]

Variables must be instantiated as null at the start of the method or program (either local or global). This type of problem arises when variables are declared "in the middle of the code" and are detected by the JAVA garbage collector.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Jérôme Verstrynge
Solution 2 Antonio Carrascosa García