英文:
Import cannot be resolved in eclipse due to the import of specific lib in an existing project
问题
我在一个需要修复的项目中遇到了一些导入错误(该项目是由他人编写的)。这是一个 Java 网页爬虫项目,开发者选择了以下导入:
import com.gargoylesoftware.htmlunit.javascript.host.file.FileReader;
import com.sun.glass.events.WindowEvent;
import com.toedter.calendar.JDateChooser;
import org.jsoup.Jsoup;
(以及许多其他库。)
错误始终是相同的:“无法解析导入<名称>。”
我猜我需要在项目路径中添加一些文件或类似的内容,但我不太清楚具体的步骤、位置和内容。
有人可以帮助我吗?
非常感谢。
英文:
I have some import errors on a project that I have to repair (which has been written by someone else). That's a java web scraper, and the developer choose to import :
import com.gargoylesoftware.htmlunit.javascript.host.file.FileReader;
import com.sun.glass.events.WindowEvent;
import com.toedter.calendar.JDateChooser;
import org.jsoup.Jsoup;
(and lot of other lib.)
The error is always the same : "The import <name> cannot be resolved."
I guess that I have to add some file in the project path or something like that, but I don't exactly know how, where and what.
Can someone help me ?
Big thanks.
答案1
得分: 1
我认为这是一个 Eclipse 的问题。尝试清理项目(项目 > 清理
)。并且仔细检查你的构建路径是否包含了所有所需的 JAR 包(无错误)。还有可能有用的是检查“问题视图”中是否有一些有用的信息。
英文:
I think it is an eclipse issue. Try to clean the project(Project > Clean
). And double-check that your build path contains all the required jars(with no errors). May also be useful to check if there is some useful information in the "Problems" view.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论