0

I am trying to set up the example code for Crawler4j, but Eclipse is throwing an error that I don't understand. The error is:

The declared package "edu.uci.ics.crawler4j.examples.basic" does not match the expected package ""

The path "edu.uci.ics.crawler4j.examples.basic" is there and correct.

Tharindu Rusira
  • 691
  • 9
  • 17
Crayl
  • 1,883
  • 7
  • 27
  • 43

1 Answers1

1

You need to run the Java compiler from the base directory, so that it sees the edu/... folder.
If you run it from the directory with the actual .java file, it won't see any folders, so it will expect the default package.

SLaks
  • 868,454
  • 176
  • 1,908
  • 1,964
  • What do you mean exactly with "run the Java compiler from the base directory". The package is in a .jar-file and from whereever I add it, Eclipse can't find it. Every other "import"-command works, for example: "import edu.uci.ics.crawler4j.crawler.CrawlConfig;" – Crayl Sep 14 '12 at 14:38