2

I try to make a java app using Jsoup.

Instead of using

(A)

import org.jsoup.Jsoup; import org.jsoup.helper.Validate; import org.jsoup.helper.Validate; import org.jsoup.nodes.Document; import org.jsoup.nodes.Element; import org.jsoup.select.Elements; 

I want to use

(B)

import org.jsoup.*; 

(A) is working but (B) is not...

I am using IntelliJ and imported the dependencies... Why is this not working ?

1
  • You need to add the Jsoup 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. after that try the online import and tell us whether it works Commented Dec 14, 2012 at 11:08

1 Answer 1

5

You should import each package like this:

import org.jsoup.*; import org.jsoup.helper.*; import org.jsoup.nodes.*; import org.jsoup.select.*; 

Since org.jsoup and org.jsoup.helper are different packages, you should import them separately.

In Eclipse, there is a function called Organize Import, perhaps there is similar functionality in InteliJ.

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

2 Comments

eclipse has ctrl+shift+O, very useful
implementation 'org.jsoup:jsoup:1.13.1' in Android Studio

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.