Using third party libraries with netbeans

java, netbeans

Solution

Why do you placed your libary into a package? Thats not how you do that. Do this instead:

- Go to project properties by right clicking on project.

- Then click on Libraries tab, You will see Compile, Run, Compile Tests, Run Tests tabs.

- Click on Compile tab (the first tab, selected by default)

- Click on Add JAR/Folder button at right

- Then browse and select the jar file(not the folder) you want to include. Included jar file will show on the following box of Compile tab.

- Click on OK button.

- Finished.

Than it will be added to you project and classpath.

You imported a complete folder into the project, but you only have a single jar file.

Problem

I am very new to Java. I am trying to use jsoup in a small project. I couldn't set up my netbeans to use it. I have opened a folder for third party libraries in `C:\Users\muhammed\jarlibraries` and I have put `jsoup-1.7.2.jar` in it. Then I right clicked on libraries and selected add jar folder. Now my project looks like this; As you can see from the image above, netbeans cannot resolve Jsoup when I say Fix Imports. Am I doing something wrong here? How would this process work?

Original source