Blue Bird
Blue Bird

Reputation: 131

import org.jsoup.* not working

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 ?

Upvotes: 2

Views: 12871

Answers (1)

ntalbs
ntalbs

Reputation: 29458

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.

Upvotes: 5

Related Questions