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'm working with a project that has a custom Ant script. I have all of my jars in the classpath and the editor recognizes all of my classes (no red-lines), but when I use Fix Imports Netbeans cannot find my classes and many built-in Java classes (such as java.util.String).
Please describe exactly your problem. And also describe steps how to reproduce it. Does IDE break your source by doing Fix Imports? There is no class as java.util.String, so IDE cannot find such class. Thanks
Definitelly no classpath problem. The classpath is used by all the features including editor's red-lines. If it was broken the editor would not work.
Waiting for more info on how to reproduce it. No code loss -> P2.
> Please describe exactly your problem. And also describe steps > how to reproduce it. Steps to reproduce: 1) Use CVS to retrieve latest source code from roller.dev.java.net 2) Edit the project's project.xml file to set project.dir 3) Open Java file (such as PlanetManagerImpl.java) 4) Observe no read lines in 27 imports, indicating that classpath is setup right 5) Right-click in editor, pick Fix Imports 6) See "Searching for dependencies" progress dialog 7) See "No imports found for following types" and a listing of 25 classes including many from java.util and java.lang 8) Click OK 9) See that there are now only 9 imports, code is broken, and will no longer compile > Does IDE break your source by doing Fix Imports? Yes, the original list of imports is thrown away and my code is broken (I have to do an undo to get back to my unbroken code) > There is no class as java.util.String, so IDE cannot find such class. Sorry, I meant to say java.lang.String
Still broken in Netbeans 4.1 RC2. One additional clue. If I delete the var/cache/mdrstorage directory, the problem will go away for a while, but will return after a couple of hours of usage.
Still broken in Netbeans 4.1 final
A developer downloaded Netbeans 4.1 today and to my surprise after I helped him set up his project, the Fix Imports could not find classes java.lang.Exception. This is a fairly annoying problem because fix imports is so handy. I'll stick with 4.0 until this is fixed. In addition to Fix Imports not working as described below, the "Seperate Classpath for Each Source Package Folder" in the project properties can not be un-checked.
Don't you face also issue #59031? Isn't it related?
Hello, could you please look to Tools/Java Platform Manager whether there are any invalid (shown in red) platforms?
No, there are no red platforms.
As I understand your project is j2seproject, isn't it? Could you attach zipped nbproject dir that is placed under the project dir? Also there is patch for issue #59031, you might want to try that patch to test if it fixes also your problem. Thanks for your help.
Snoopdave, I tried to follow your steps. 1) I downloaded roller-src-1.1.2.tar.gz and roller-tools-1.1.2.tar.gz 2) I edited ant.properties to set project.dir 3) I created Java Project with Existing Ant script. (sources set to roller/src - test set to roller/test) - I set Source package folder and test package folder - I did not add dependent jars since there about thirty jars. 4) I was not able to find PlanetManagerImpl.java - I found it in ./sandbox/planetroller/build/planet-roller/src/org/roller/business/PlanetManagerImpl.java ./sandbox/planetroller/src/org/roller/business/PlanetManagerImpl.java but this looks like different projects. 5) I opened BookmarkManagerImpl.java instead. 6) There was some unresolved classes like org.apache.commons.logging.Log or org.jdom.Document b ecause I did not add libraries. Other that that Fix All Imports worked fine and was able to resolve classes from JDK. Please update your steps how to reproduce it. Especially the part about setting up NetBeans Project with Existing Ant Script is important. Thanks.
Closing until more information is vailable.