Java – How to get Netbeans 6.5 shareable libraries working

javanetbeansnetbeans6.5shared-libraries

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?

Best Answer

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.