This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
"cannot find symbol"-error hint light up on some package-local classes, the code compiles but Netbeans IDE report that the code can not be found. It does not happen if the file that contains the package-local class is open.
Do you have a test case reproducible from scratch? It is very hard to do anything about it without a reproducible test case.
It happened to me too: when i call a method of a class which doesn't have directly the method but extends a class which extends a class whitch extends a class of a Jar imported in the project. for example i call x.meth(); x is an istance of the class X. X doesn't have the method meth() but extends A. A doesn't have the method meth() but extends B. B is contained in a Jar imported as library
file one: Main.java public class Main implements Finder { public static void main(String[] args) { new FindMe().find(); } public void find() { throw new UnsupportedOperationException("Not supported yet."); } } file two: Calling.java interface Finder { void find(); } class FindMe { public void find() { } } public class Calling { } Create a new project and open only Main.java and see the error: Error in "public class Main implements Finder" - "cannot find symbol class Finder"
I have this problem too with a package of javax.swing (JPasswordField). Netbeans seems to don't recognize the symbol, but it compiles perfectly and the Passwordfield works normaly. It happened suddenly and don't know which was the trigger. ---> Error cannot find symbol symbol : class JPasswordField location: package javax.swing Inicio.java 336 D:/Alex/consultaTelecargas/src/interfaz
The use case described in desc4 is a duplicate of 118879 (class-living-elsewhere). Moreover, I cannot reproduce it in --- Product Version: NetBeans IDE Dev (Build 080319) Java: 1.5.0_13; Java HotSpot(TM) Client VM 1.5.0_13-119 System: Mac OS X version 10.5.2 running on i386; MacRoman; en_US (nb) Userdir: /Volumes/Sources/trunk_hg/main/nbbuild/testuserdir
*** Issue 117502 has been marked as a duplicate of this issue. ***
Build: NetBeans IDE 6.1 Beta (Build 200803050202) VM: Java HotSpot(TM) Client VM, 1.6.0_03-b05 OS: Windows XP, 5.1, x86 User Comments:
Created attachment 59116 [details] stacktrace
Product Version: NetBeans IDE 6.1 RC2 (Build 200804170002) Java: 1.6.0_10-beta; Java HotSpot(TM) Client VM 11.0-b11 System: Windows XP version 5.1 running on x86; Cp1250; cs_CZ (nb) I am not able to reproduce this (desc4) either. Well, when I try to compile the example classes, compiler really informs about the missing classes (caused by the "class in a class"), but after a succesful build, everything seems to be OK - no error badges, no problems during compiling. I am removing the INCOMPLETE status for now (otherwise it should be closed now as nobody responds for 4 weeks now). To be honest I am not quite sure, whether it is still one issue (for example: is the reported NPE really connected with the original issue?) Please, can someone evaluate this? Thanks
I'm marking this as duplicate 118879 - the original report is class-living-else problem. I cannot reproduce it now as well, but this may be dependent on current thread scheduling (e.g dependent on OS, JDK version, project structure etc...). *** This issue has been marked as a duplicate of 118879 ***
This issue has already 10 duplicates see http://statistics.netbeans.org/exceptions/detail.do?id=5894
Created attachment 63249 [details] stacktrace
for my case solution is quite simple: NetBeans holds some information for projects loaded (or "opened") into the IDE outside of projects workshop. That information caused exception I noted and it is preserved by IDE while opening and closing NetBeans IDE itself. So, to resolve "Existent classes appear as non-existent" bug, just select "File|Close Project" and then, reload the same project by selecting them into "File|Open Recent Project>" submenu. Note again, this will definitely help only if trouble started by following steps: 1. Java Class (simple or Swing JPanel, JForm etc.), called fex. SomeName, created inside of IDE; 2. SomeName deleted (even non-"safe", totally) inside of IDE; 3. SomeName created again (no matter which type) at the same package level. P.S. Once upon a time, similar bug - but not so easy-to-resolve, was produced by Visual Studio v.5... or v.6... something. Is it caused now by the same programmer fired out of Microsoft due to incompetency?;)
This issue has already 20 duplicates see http://statistics.netbeans.org/exceptions/detail.do?id=5894
The "Cannot find symbol" errors generally occur when you try to reference an undeclared variable in your code. A "Cannot find symbol" error means that the compiler cannot do this. Your code appears to be referring to something that the compiler doesn't understand. When your code is compiled, the compiler needs to work out what each and every identifier in your code means. As the compiler is going through the code it will find something and know what to do with it or not. Your Cannot find symbol error relates to the identifiers and means that Java cannot figure out what the "symbol" means. The general causes for a Cannot find symbol error are things like: Incorrect spelling. Wrong case. Halo is different from halo. Improper use of acceptable identifier values (letters, numbers, underscore, dollar sign), my-class is not the same as myclass. No variable declaration or variable is outside of the scope you are referencing it in. http://net-informations.com/java/cjava/symbol.htm