0

I downloaded the .jar Jsoup file from jsoup.org/download. I then ran eclipse and imported the .jar files into a java project. However, I keep getting an error when I type

import org.jsoup.nodes.*;

I want to use the Document class in that file.

I made sure the syntax was correct and everything, but the error won't go away. Anyone know what the problem could be?

2 Answers 2

1

You need to add the JAR file to project's build path. Drop the JAR in the project's root folder or some /lib folder, rightclick the JAR file and then choose Build Path > Add to Build Path.


Unrelated to the concrete problem, using wildcard imports is not the best practice. Rather specify the imports separately, or just let Eclipse autocomplete it by entering Ctrl+Space after typing Document in the code.

Sign up to request clarification or add additional context in comments.

Comments

0

Right click on project in Eclipse > Properties > Java Build Path > Add Jar > select the jar from your project which you imported before > ok

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.