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.
I frequently get the following exceptions even after clearing out my var/cache: org.netbeans.lib.java.parser.CompilerException: Fatal Error: Unable to find package java.lang in classpath or bootclasspath at org.netbeans.lib.gjast.ASErrorChecker.parse(ASErrorChecker.java:59) at org.netbeans.modules.javacore.jmiimpl.javamodel.ResourceImpl$ErrorList.initCheck(ResourceImpl.java:1428) at org.netbeans.modules.javacore.jmiimpl.javamodel.ResourceImpl$ErrorList.size(ResourceImpl.java:1440) at org.netbeans.modules.java.JavaEditor.refreshAnnotations(JavaEditor.java:389) at org.netbeans.modules.java.JavaEditor.access$300(JavaEditor.java:83) at org.netbeans.modules.java.JavaEditor$16.run(JavaEditor.java:1416) at org.openide.util.Task.run(Task.java:189) at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:330) at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:721) This was after a fresh install of 4.1 pointing to JDK 1.5.02. java version "1.5.0_02" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_02-b09) Java HotSpot(TM) Client VM (build 1.5.0_02-b09, mixed mode)
What kind of project do you use? Do you see the rt.jar under the Libraries node? Is java.lang package under the rt.jar in the Libraries node?
I'm using the "module project" (API Support Module). I don't have a "Libraries" node in this project type.
I have seen similar problem. I think that the problem is this: The API Support's project selects the platform as follows: a) find some platform with version ${javac.source} (default javac.source is 1.4). b) if no platform is found in step a), select default platform. The platform chosen in step a) is not tested to be valid. If an invalid (removed from disk) platform is chosen, the exception occurs (in the log). As a workaround, please go to Tools/Java Platform Manager, remove all invalid platforms and create a valid one for required javac.source. Does this help?
I did have an invalid java platform reference. I've removed the invalid reference and will watch to see if I get the error again. I usually only see it when I exit the IDE and come back in.
Platform manager should remove anything which is not valid.
I don't agree that Platform Manager should remove broken platforms. The better solution is to have isValid () method on the JavaPlatform.
I'm also having this problem, on NetBeans 4.1, JDK 1.5.0_04, Windows XP SP2. I don't have any invalid platforms and I'm working with a free-form web-app project, so I don't have any library node Auto-complete doesn't work, and deleting the cache doesn't help. And I can't delete the JDK 1.5 platform, since it's the default platform. The error is: Using 'jar:file:/C:/Program%20Files/Java/jdk1.5.0_04/jre/lib/rt.jar!/' pre- parsed database! Using 'jar:file:/C:/Program%20Files/Java/jdk1.5.0_04/src.zip!/1.5' pre-parsed database! [org.netbeans.javacore] INFORMATIONAL *********** Exception occurred ************ at 7:14 PM on Aug 29, 2005 org.netbeans.lib.java.parser.CompilerException: Fatal Error: Unable to find package java.lang in classpath or bootclasspath at org.netbeans.lib.gjast.ASErrorChecker.parse(ASErrorChecker.java:59) at org.netbeans.modules.javacore.jmiimpl.javamodel.ResourceImpl$ErrorList.initChec k(ResourceImpl.java:1428) at org.netbeans.modules.javacore.jmiimpl.javamodel.ResourceImpl$ErrorList.size (ResourceImpl.java:1440) at org.netbeans.modules.java.JavaEditor.refreshAnnotations (JavaEditor.java:389) at org.netbeans.modules.java.JavaEditor.access$300(JavaEditor.java:83) at org.netbeans.modules.java.JavaEditor$16.run(JavaEditor.java:1416) at org.openide.util.Task.run(Task.java:189) at org.openide.util.RequestProcessor$Task.run (RequestProcessor.java:330) at org.openide.util.RequestProcessor$Processor.run (RequestProcessor.java:721) Caused by: com.sun.tools.javac.util.FatalError: Fatal Error: Unable to find package java.lang in classpath or bootclasspath at com.sun.tools.javac.comp.MemberEnter.importAll(MemberEnter.java:120) at com.sun.tools.javac.comp.MemberEnter.visitTopLevel (MemberEnter.java:503) at com.sun.tools.javac.tree.Tree$TopLevel.accept(Tree.java:390) at com.sun.tools.javac.comp.MemberEnter.memberEnter (MemberEnter.java:383) at com.sun.tools.javac.comp.MemberEnter.complete(MemberEnter.java:777) at com.sun.tools.javac.code.Symbol.complete(Symbol.java:355) at com.sun.tools.javac.code.Symbol$ClassSymbol.complete (Symbol.java:614) at com.sun.tools.javac.comp.Enter.complete(Enter.java:448) at com.sun.tools.javac.comp.Enter.main(Enter.java:426) at org.netbeans.lib.gjast.ASErrorChecker.compile (ASErrorChecker.java:173) at org.netbeans.lib.gjast.ASErrorChecker.parse(ASErrorChecker.java:56) [catch] ... 8 more
At the time the error occurred, I had 15-20 projects opened simultaneously, and each project had 40-50 entries in Java Sources Classpath and/or the Web Sources Classpath. After closing all projects except one, removing all entries from the classpaths of the remaining project, and restarting the IDE, auto-complete started working again. I'll get back if I find the exact project or classpath entry that causes the problem.
I'm still having this problem, and another developer from my team that uses NB 4.1 also has this problem. I was unable to locate a specific classpath entry that causes this issue, and the only workaround is to close the project, close the IDE, delete the /var/cache folder, start the IDE, reopen the project. But, after about 5 minutes, the problem reappears. I have about 60 jars and 10 directories in classpath. When I have less entries in classpath, it takes more time to reproduce the problem. This is a show-stopper for me. And I'm seriously thinking about downgrading to NB 3.6 if this bug is not fixed soon.
Why is this a showstopper for you? What key functionality breaks when these exceptions start to appear in the console? Could you please provide the whole messages.log as an attachment to this issue? (located in /var/log)
It is strange that erasing the var/cache helps. The exception is thrown when the javac (used to finding errors in the file) cannot find the rt.jar on the project bootpath, it is strange that path to rt.jar is invalid and becomes valid after restart. The erasing of var/cache should not have effect on this behavior.
Created attachment 24595 [details] Full IDE Log
This is a show-stopper for me, because code completion stops working.
After taking a second look at messages.log, I think that my code completion problem could also be related to issue 61102 (java.lang.Exception: rollback!!!).
Weird. From the messages.log it seems your project is broken in some way. Could you please give us more info about your project setup? Do you keep class files in the same directory as the sources? Code completion for which classes stops working? Does the code completion for the JDK classes ever work? Instead of downgrading to NB 3.6, could you try to upgrade to one of the q-builds or dev builds of NB 5.0 (formerly 4.2), see if you can reproduce it there and send us fresh logs if so?
My project is a "Web Application with Existing Ant Script", the Web Pages are stored in the project root. The Java sources and the class files are stored in WEB-INF/classes. The code completion stops working for the JDK classes, including java.lang.*, and also for the jars and directories from "Java Sources Classpath". However, it works for the methods/fields defined in the source file I'm currently editing. I will try to reproduces the problem with NB 5.0.
And after cleaning /var/cache and closing and opening the project, code completion works fine a few minutes, for all classes (classpath, JDK, WEB- INF/classes).
Is the cleaning of /var/cache significant? Doesn't it work even without it (after you close and reopen the project and restarting netbeans)? Try to identify what do you do just before the problems start to occur. Could this be related to building the project? (i.e. when all works after cleaning /var/cache and restarting netbeans, does it break again after you do a clean build of your project?) Or can you see some other action that seems to initiate these problems?
Re Web freeform project problems: it seems to me that you are experiencing issue #59031.
As far as I know there was some problem in the freeform project regarding the platform which Honza already fixed in the NB 5.0. Can you try some NB 5.0 q-build? Honzo can you evaluate this?
Yes, it seems to be issue #59031 . I didn't notice the "updates available" icon in the lower right corner of the IDE (I expected to see a pop-up window when updates are available), so I didn't have the hot-fix installed. Now I installed the hot-fix, and I hope the problem is gone. Sorry for the confusion.
Works in NB 5.0
It's the case in Netbeans 8.2 on Raspbian Jessie .This Fatal Error appears after install properly JDK and JavaME SDK any help on this forum? thanx
In reply to comment #23: Please create a new issue. This issue is already invalid (it's for NetBeans 5.0) and the code in the issue is no more contained in the product. Please create a new issue with IDE version and valid stack trace. Thanks!