由于在现有项目中导入特定库,Eclipse 中的导入无法解析。

huangapple go评论86阅读模式
英文:

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 &gt; 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.

huangapple
  • 本文由 发表于 2020年10月25日 21:53:23
  • 转载请务必保留本文链接:https://go.coder-hub.com/64524471.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定