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.
[ BUILD # : 200408191357 ] [ JDK VERSION : J2SE 1.5.0 ] Netbeans isn't able to compile a class because there's a jar missing in the classpath. I add this jar to my classpath. Recompile the file but the error message remains. Restart didn't change this behaviour
Pardon a possibly stupid question: How do you add the jar to the classpath? What exact steps you perform in the IDE?
I opened the properties of the project. You can specify the classpath. There I select the add jars. Search for the jar and add it.
Ok, got it. Thanks. Yes, that's the way it should work.
I tried to reproduce that, ... but no success. Please set ant verbosity to Verbose (Tools | Options -> Ant Settings -> Verbosity Level) and look into output log (or append to this issue) if compilation arguments are correct according to what to have set in project properties. Have you been doing something "special" with the jar file? E.g externally rebuilding when it was set in compilation classpath, removing it, putting it back, whatever else?
Sorry, people do this routinely and it works fine AFAIK; please let us know what you are doing differently. Make sure you are adding to the compile classpath, not just the run classpath.
Created attachment 17308 [details] Picture of the jars
I've made a picture where you can see the error message, the classpath, the windows explorer to the jar and the content of the jar.
Yes your attachment shows that there might be something wrong. Please answer my previous question: Have you been doing something "special" with the jar file? E.g externally rebuilding when it was set in compilation classpath, removing it, putting it back, whatever else? Please describe exactly how you set up your project. Thank you very much. Reopening, lowering prio.
Project setup: - jdk 1.3.1 - target directory is different from the project properties I added the jars as described. But no change. If tried to delete and readd the jars. No change. Restart makes also no difference. So I was not able to work if changed the ide. I used the 4.0 beta and the 3.6 to get my work done. I had the same problem with a logger class and I couldn't compile. Then I've worked with different Netbeans versions and after that I used the q-build again and I think I was able to compile. I don't know if there are problems regarding using three different versions. So some additional information for you: - I will start the ide just once a day if a problem/test occurs that requires restart I will test it the next day => The start of the ide takes on my system over ten minutes. There's already a bug open. - I have to work with different ide versions because * I'm not able to debug in 4.0 => There's already a bug open. (But it seems that debugging no longer works in 3.6 for me, too.) * I test the Netbeans. So if I can't work with the q-build. I try to work with the beta.
Picture doesn't show anything unusual. Need to have your project metadata (complete nbproject/ directory), and output of the build run with Ant Settings -> Verbosity set to Verbose, and your IDE's messages.log file. Again, any information that would differentiate the problematic situation from a normal, working situation would be helpful in guessing where the problem is. Cannot do anything with this as it is.
Created attachment 17330 [details] Log-file
Created attachment 17331 [details] Metadata of project
Created attachment 17332 [details] Verbose output
OK, well the javac command run by <javac> does not include ant.jar at least, which is odd since project.properties + private.properties seem to include it. Need Ant output at Debug level to see why that classpath entry is being skipped. BTW reporter: your classpath seems to include C:\ptc\wt626\codebase\WEB-INF\lib which is probably wrong; I assume you wanted to include some JAR files located in this directory in your classpath, rather than the directory itself (unless you really have unpacked *.class files under it, which I believe is incorrect for web apps).
Requested information not supplied. Reopen if you can attach more details.
Created attachment 17542 [details] Verbose ant output
I set the ant to verbose and attached is the output.
No, I asked for *debug* level. You already attached verbose output before and it wasn't enough.
Created attachment 17562 [details] Debug Output - sorry
Well that narrows things down, but it's still a mystery to me. The debug logging seems to indicate that Ant is loading a completely different set of property files than the ones you have attached. For example it says Loading C:\Daten\Audi\nbproject\private\private.properties However the properties it loads from there differ from the private.properties you have attached: it misses most of the file.reference.* properties, and sets javac.debug to false, not true. Similarly, when it is Loading C:\Daten\Audi\nbproject\project.properties then javac.classpath is missing several JARs that were not defined in the private.properties it actually loaded - which is expected - but what it does have is in a different order than the attached project.properties indicates. I.e. it actually set the property to C:\ptc\wt626\codebase\WEB-INF\lib\JGL.jar;C:\ptc\wt626\codebase\log4j.jar;C:\ptc\wt626\codebase whereas the expected value would have log4.jar before JGL.jar (etc.) and would have unsubstituted property references for e.g. ${file.reference.ant.jar}. The log indicates that it is indeed running C:\Daten\Audi\build.xml, consistent with the names of the property files it is loading. So what this looks like is that you are running a valid project in C:\Daten\Audi which is simply missing a number of classpath elements, i.e. they were never added; and that the project metadata you attached is from a completely different project (but which is displayed in your screenshot). It seems you are running the compile-single target (i.e. F9, Compile File). Such file-sensitive actions first find the project associated with a file, then ask it to run the target. In the case of projects with external source roots, the project when loaded into the IDE (not necessarily opened) marks the external source root as belonging to it. Perhaps you are opening C:\Daten\Audi2 (e.g.) but an obsolete C:\Daten\Audi is already loaded for some other reason and is also trying to claim the same files - e.g. presence in the Recent Projects list might do it, or selecting the folder in the Open Project dialog would do it, etc. So if C:\Daten\Audi is in fact *not* the project dir you are trying to use, delete it.
So my question is how do I set up my project correct? First of all I have a source directory C:\ptc\wt626\wtcustom\Windchill\src. Then I have a target directory C:\ptc\wt626\codebase. Netbeans creates now some project specific files that I don't want in my target directory. I get the hint from Jiri to change the project.properties. That's means my project directory is C:\Daten\Audi. But my target directory is build.classes.dir=${build.dir}/codebase and the build.dir=c:/ptc/wt626.
It's perfectly fine to have a project dir somewhere completely different than either your sources, and probably works OK to have built classes elsewhere too (though probably untested by us). I'm just pointing out that the project you attached to this issue is not the project you were running in the log file I saw. So something is confused in your system. Without 100% reproducible steps to recreate the problem on a fresh machine, I can only guess what.
I have removed the whole 4.0 installation (installation, project data and .netbeans). Today I've installed the new q-build. Now everything is working fine. Thank's a lot. I can now working.