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 46482 - [40cat] Cannot add libraries to freeform project
Summary: [40cat] Cannot add libraries to freeform project
Alias: None
Product: projects
Classification: Unclassified
Component: Ant (show other bugs)
Version: 8.2
Hardware: PC Windows 7 x64
: P3 blocker (vote)
Assignee: Jesse Glick
Depends on:
Reported: 2004-07-23 09:18 UTC by gugrim
Modified: 2017-04-22 14:15 UTC (History)
2 users (show)

See Also:
Exception Reporter:


Note You need to log in before you can comment on or make changes to this bug.
Description gugrim 2004-07-23 09:18:17 UTC
The classpath pane in the Freeform UI does not
allow you to add a Library or other project, only
Comment 1 psuk 2004-07-26 10:00:36 UTC
Comment 2 Jesse Glick 2004-08-04 02:59:21 UTC
As designed.
Comment 3 gugrim 2004-08-05 18:40:26 UTC
OK, I change it to enhancement and elaborate a bit.

One of the many advantages with libraries is that a version controlled
project definition can specify that certain libraries are needed but
the exact physical location of the jars can differ between developers.
The team can probably agree on the library names but often not on
where they are located on disk. This and all pure convenience reasons
for libraries are I believe equaly valid for freeform projects as for
any other project type.

One problem with the current classpath definition is that you don't
have access to it in your build script. You have to make sure that the
two are synchronized. It would probably not be very difficult to
ensure that a property file is updated (much like what j2seproject
does) before the script is run that contains the complete classpath.
If libraries could be used this technique would be even more useful,
since the sourcepath could then also be made available to the script,
esp useful for the nbjpdastart task.
Comment 4 ender01 2004-10-15 18:47:18 UTC
A good example of why we should be able to do this is in the form for
the freeform web project. Netbeans comes with the all the needed
libraries, but because we cant add the actual Library that NB uses, we
need to hunt down each of the needed j2ee jars that we need
(servlet-api.jar, etc..) and add them AND we loose javadoc support.

By simply adding a library it takes care of these problems and others
as Gunnar has pointed out.

so its gets a +1 in my book 
Comment 5 Jesse Glick 2004-10-19 23:33:38 UTC
Wrong component, probably no one saw this issue after it was reopened...
Comment 6 Jesse Glick 2004-10-19 23:38:48 UTC
You can already add the same JAR as you use in the lib mgr to
project.xml's classpath and you will get sources/Javadoc. (See issue
#47498 for more.)

If you really wanted to, you could also load
${netbeans.user}/ to share classpath definitions with
the IDE's lib mgr, though generally I don't recommend this - better to
keep your libs under version control in a shared location. See also
issue #44035.

Re. synching the build script w/ project.xml, which as far as I can
tell is the only other thing mentioned here: see instead issue #46485.
Comment 7 gugrim 2004-10-20 16:45:42 UTC
I must disagree here. The arguments I stated in my 2004-08-05 commment
still stand IMO. Libraries often reference several jars and in several
freeform project I want to be able to say that I use e g "Sun App
Server Client" instead of specifying all six or seven jars. Also, I
may keep these files in a different place than other team members but
since we can agree on the library name we could use the same project.xml.
Comment 8 gugrim 2004-10-20 16:46:36 UTC
Forgot to reopen
Comment 9 Jesse Glick 2004-10-20 19:10:26 UTC
As I said, you can already do this, if you load
${netbeans.user}/ into your project.xml and your build
script (if you wish to use the IDE's library manager GUI) or any other
properties file (if you do not). Issue #47498 already proposes some
kind of library management GUI that would make sense in the context of
freeform projects, which in many cases would not want to depend on the
current library manager's Please use #47498 for this

*** This issue has been marked as a duplicate of 47498 ***
Comment 10 Jiri Kovalsky 2004-11-04 14:32:36 UTC
This is originally a NetCAT enhancement.
Comment 11 Marian Mirilovic 2005-07-19 15:11:50 UTC
Comment 12 javatlacati 2015-10-30 20:17:51 UTC
In the 8.1 beta I opened a seam project as a netbeans free form project and can add sources jar but nor libraries jar.
I'd like something like an space in the project properties window that allow us to select projects and library jars.
Then when running ant task configured as run the libraries & the dist folder of projects can be addeded temporarily to class path. When the stop button is hit, then reset classpath to the original config.
Comment 13 brutzman 2017-04-22 14:15:31 UTC
Not having the ability to add an external .jar to a Java Free-Form Project means that contained code is always erroneous in the editor, and only compilable/runnable using Ant.