954,536 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Netbeans : how to install 3rd parties library?

Does anyone know how to correctly add a 3rd party library to
NetBeans?

I have NetBeans 6.7.1

The library is from this site : Link . Its called wheels, and its for my class.

It comes in a zip file.

What I tried was this :

1) Set the zip file into my c drive
2) Start up netbeans
3) Click tools->library
4) Click class Libraries
5) click new Library
6) Called it Wheels
7) Under classPath tab , I set the zip file directory
8) same as 7 for source tab
9) Click OK

10) Try to import it like so : import Wheels.user.*;
and Error occurred.

firstPerson
Senior Poster
3,923 posts since Dec 2008
Reputation Points: 841
Solved Threads: 608
 

project -> properties -> libraries -> add jar

masijade
Industrious Poster
Moderator
4,253 posts since Feb 2006
Reputation Points: 1,471
Solved Threads: 494
 
project -> properties -> libraries -> add jar

Thanks, it worked. Is there a way to make this apply to every project
without doing it manually?

firstPerson
Senior Poster
3,923 posts since Dec 2008
Reputation Points: 841
Solved Threads: 608
 

What does the documentation say? But, no, probably not. There might be (in the Window -> preferences/options area) a way to designate "default" jars, but I doubt it.

Change the startup of NetBeans to include it on NetBeans' classpath and NetBeans will have access to it, which does not necessarily mean that the projects in NetBeans would have access to it. And, even if they did, it wouldn't help much in the end, as once you have built a deployment jar from the project it would no longer have that jar on it's calsspath and so wouldn't "work". Adding it to the project will cause NetBeans to include that jar in the projects "dist" directory and add it to the deployments jars classpath in its manifest.

masijade
Industrious Poster
Moderator
4,253 posts since Feb 2006
Reputation Points: 1,471
Solved Threads: 494
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You