Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

is not a known variable in the current context

Tags:

netbeans

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 ?

like image 643
mehdi shahdoost Avatar asked Jun 09 '11 11:06

mehdi shahdoost


2 Answers

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.

like image 160
Jérôme Verstrynge Avatar answered Nov 15 '22 11:11

Jérôme Verstrynge


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.

like image 34
Antonio Carrascosa García Avatar answered Nov 15 '22 10:11

Antonio Carrascosa García