yasar
yasar

Reputation: 13728

Using third party libraries with netbeans

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;

enter image description here

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?

Upvotes: 2

Views: 11236

Answers (1)

Dennis Kriechel
Dennis Kriechel

Reputation: 3749

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

  1. Go to project properties by right clicking on project.
  2. Then click on Libraries tab, You will see Compile, Run, Compile Tests, Run Tests tabs.
  3. Click on Compile tab (the first tab, selected by default)
  4. Click on Add JAR/Folder button at right
  5. 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.
  6. Click on OK button.
  7. 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.

Upvotes: 8

Related Questions