How to get Netbeans 6.5 shareable libraries working
Asked Answered
N

5

8

I created a Web application in Netbeans 6.5. Now I want to use the Joda Time library. I want to share this library via subversion, because I don't want my team mates to be dependend on some Netbeans configuration.

Just to get the project working, I first added the library to the Netbeans library (Tools->Library). This worked OK. The JAR is added to the classpath, and is also deployed.

But when I create a shared library (via Project Properties->Libraries->Browse/New Libraries Folder), the JAR is not in the classpath. I get the error message package org.joda.time does not exist on the code import org.joda.time.*.

Any ideas?

Nomography answered 5/3, 2009 at 14:5 Comment(3)
I'd like to know too. We eventually gave up and just keep copies of libraries on a server...Vine
I give up too. I want to notice: when creating a new Web application project, and checking "Use dedicated folder for storing libraries", everything works just find. But I can't find any difference between the two projects :-(Nomography
Is this any help? bigallan.blogspot.com/2008/03/…Wb
P
1

What is the scope of this library? Is this library used for just this particular web-application?

If so, can we put the library in the WEB-INF/lib directory and check that into subversion as well?

Libraries in the WEB-INF/lib directory should be automatically added to the classpath of the project.

Phrase answered 29/3, 2009 at 15:20 Comment(1)
Libraries in WEB-INF/lib are not exposed at compile time, and that is just what I need..Nomography
H
0

Here is what I did:

  • Tools -> Library -> New Library...

    • called the library joda-time
    • add added the joda-time-1.6.jar file to it
  • Project -> Properties -> Libraries

    • under the compile tab
      • Add library...
      • selected joda-time

(Edit, think I see the issue now - but perhaps not).

You need to add the library to the compile libraries AND add it to the distribution libraries. Or am I misunderstanding the question?

Homothermal answered 5/3, 2009 at 16:40 Comment(1)
I have added the library to the compile time tab. But when you do it like this, you can't share the library. Other team members have to add the library to their global library (tools->library), and I wanted to prevent just that.Nomography
D
0

This blog entry describes a hack that worked in NetBeans 5. I don't know if it will work in NetBeans 6.5. I also don't know if this will work if you are building files nightly on a server.

http://blogs.oracle.com/gjmurphy/entry/using_netbeans_free-form_projects_as

I remember setting up shared libraries like this 8 years ago in JBuilder. I wish Netbeans had it by now.

Danika answered 20/3, 2009 at 10:32 Comment(0)
D
0

when creating a 'new project', there is an option to enable 'dedicated folder for libraries'. That way, the libraries will also be committed to the repository and your peer developer can checkout your project with all the libraries, your project has dependencies upon, thereby eliminating netbeans configuration bound.

Debauchery answered 31/3, 2009 at 7:19 Comment(0)
Y
0

In scenario where a project depends on JARs which can be placed in different locations for different users, a named IDE variable can be used.

http://wiki.netbeans.org/NewAndNoteWorthyNB65#section-NewAndNoteWorthyNB65-VariableBasedPathsInJ2SEJ2EEProjects

Another option would be to use the Maven plugin which already works quite well in NetBeans 6.5. A Intranet repository for the Artifact Jar files could be placed on a file server, or managed through a Maven Proxy like Nexus.

Yeeyegg answered 13/4, 2009 at 15:9 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.