简体   繁体   English

Java-Eclipse-声明的软件包“ edu.uci.ics.crawler4j.examples.basic”与预期的软件包“”不匹配

[英]Java - Eclipse - The declared package “edu.uci.ics.crawler4j.examples.basic” does not match the expected package “”

I am trying to set up the example code for Crawler4j , but Eclipse is throwing an error that I don't understand. 我正在尝试为Crawler4j设置示例代码,但是Eclipse抛出了我不理解的错误。 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. 路径“ edu.uci.ics.crawler4j.examples.basic”在那里并且正确。

You need to run the Java compiler from the base directory, so that it sees the edu/... folder. 您需要从基本目录运行Java编译器,以便它可以看到edu/...文件夹。
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. 如果您从带有实际.java文件的目录中运行它,它将看不到任何文件夹,因此它将使用默认软件包。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM