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.

project -> properties -> libraries -> add jar

commented: Thanks man. +4

project -> properties -> libraries -> add jar

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

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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.