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.

Bug 48284 - [40cat] Adding new jars
Summary: [40cat] Adding new jars
Status: RESOLVED WORKSFORME
Alias: None
Product: java
Classification: Unclassified
Component: Project (show other bugs)
Version: 4.x
Hardware: PC Windows ME/2000
: P3 blocker (vote)
Assignee: Jesse Glick
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-09-01 10:03 UTC by meliandra
Modified: 2004-09-11 16:33 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Picture of the jars (314.96 KB, image/jpeg)
2004-09-02 09:45 UTC, meliandra
Details
Log-file (215.51 KB, text/plain)
2004-09-02 17:11 UTC, meliandra
Details
Metadata of project (6.18 KB, patch)
2004-09-02 17:14 UTC, meliandra
Details | Diff
Verbose output (22.28 KB, text/plain)
2004-09-02 17:15 UTC, meliandra
Details
Verbose ant output (6.60 KB, text/plain)
2004-09-10 10:37 UTC, meliandra
Details
Debug Output - sorry (19.24 KB, text/plain)
2004-09-10 18:42 UTC, meliandra
Details

Note You need to log in before you can comment on or make changes to this bug.
Description meliandra 2004-09-01 10:03:01 UTC
[ 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
Comment 1 Jan Chalupa 2004-09-01 13:32:45 UTC
Pardon a possibly stupid question: How do you add the jar to the
classpath? What exact steps you perform in the IDE?
Comment 2 meliandra 2004-09-01 13:35:14 UTC
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.

Comment 3 Jan Chalupa 2004-09-01 13:42:28 UTC
Ok, got it. Thanks. Yes, that's the way it should work.
Comment 4 Milan Kubec 2004-09-01 14:46:41 UTC
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?
Comment 5 Jesse Glick 2004-09-01 16:27:54 UTC
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.
Comment 6 meliandra 2004-09-02 09:45:19 UTC
Created attachment 17308 [details]
Picture of the jars
Comment 7 meliandra 2004-09-02 09:47:14 UTC
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.

Comment 8 Milan Kubec 2004-09-02 10:59:18 UTC
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.
Comment 9 meliandra 2004-09-02 11:25:17 UTC
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.

Comment 10 Jesse Glick 2004-09-02 16:05:52 UTC
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.
Comment 11 meliandra 2004-09-02 17:11:52 UTC
Created attachment 17330 [details]
Log-file
Comment 12 meliandra 2004-09-02 17:14:16 UTC
Created attachment 17331 [details]
Metadata of project
Comment 13 meliandra 2004-09-02 17:15:00 UTC
Created attachment 17332 [details]
Verbose output
Comment 14 Jesse Glick 2004-09-02 18:58:03 UTC
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).
Comment 15 Jesse Glick 2004-09-09 17:53:01 UTC
Requested information not supplied. Reopen if you can attach more details.
Comment 16 meliandra 2004-09-10 10:37:20 UTC
Created attachment 17542 [details]
Verbose ant output
Comment 17 meliandra 2004-09-10 10:37:55 UTC
I set the ant to verbose and attached is the output.

Comment 18 Jesse Glick 2004-09-10 16:41:03 UTC
No, I asked for *debug* level. You already attached verbose output
before and it wasn't enough.
Comment 19 meliandra 2004-09-10 18:42:03 UTC
Created attachment 17562 [details]
Debug Output - sorry
Comment 20 Jesse Glick 2004-09-10 20:03:24 UTC
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.
Comment 21 meliandra 2004-09-10 22:22:10 UTC
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.
Comment 22 Jesse Glick 2004-09-10 23:39:30 UTC
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.
Comment 23 meliandra 2004-09-11 16:33:32 UTC
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.