Eclipse 中我的项目旁边有一个红色感叹号是什么原因?

发布于 2024-11-08 07:22:20 字数 193 浏览 0 评论 0 原文

我在 Eclipse 中的项目名称上有一个红色感叹号,如下所示 - 在此处输入图像描述

有谁知道这意味着什么以及我应该做什么?

I have a red exclamation mark over my project name in Eclipse, looking like this - enter image description here.

Does anyone know what this means and what I should I do about it?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(28

兔小萌 2024-11-15 07:22:20

有一个“问题”视图(尝试“窗口”->“显示视图”)显示此类内容。

它通常会缺少 Jars(例如,您的项目配置引用了一个不存在的 jar),以及类似的事情,就 JDT 而言,但显然现在 Eclipse 可以以多种方式使用,它可以是任何东西。

There is a Problems view (try Window->Show View) which shows this kind of thing.

It's usually missing Jars (eg your project configuration references a jar that isn't there), and that kind of thing, in the case of JDT, but obviously these days Eclipse can be used in so many ways, it could be anything.

甲如呢乙后呢 2024-11-15 07:22:20

这意味着您的项目中的构建路径有问题。如果它是一个android项目,那么这主要意味着找不到project.properties文件中指定的目标值。这也可能是由于其他类型的内置问题引起的。但它主要仅针对构建问题显示。请参阅此处了解更多细节。这是关于在 Eclipse 中看到的构建错误装饰器。

该页面的摘录:

构建路径问题有时很容易在其他问题中被忽略
一个项目。 Package Explorer 和 Project Explorer 视图现在显示
Java 项目和包含构建的工作集上的新装饰器
路径错误:

在此处输入图像描述

具体的错误可以在问题视图中看到,如果你打开
查看菜单并选择分组依据 > Java问题类型,它们都显示
在“构建路径”类别中:

在此处输入图像描述

It means there is a problem with the build path in your project. If it is an android project then it mostly means the target value specified in project.properties file cannot be found. This can also be caused because of other kinds of built problems. But it is shown mostly for built problems only. See here for more details. It is about built error decorater seen in eclipse.

An extract from that page:

Build path problems are sometimes easy to miss among other problems in
a project. The Package Explorer and Project Explorer views now show a
new decorator on Java projects and working sets that contain build
path errors:

enter image description here

The concrete errors can be seen in the Problems view, and if you open
the view menu and select Group By > Java Problem Type, they all show
up in the Build Path category:

enter image description here

人生戏 2024-11-15 07:22:20

我也遇到过这个问题好几次,我可以通过删除“问题”选项卡中的消息并再次构建项目来“解决”它。选择项目,点击菜单栏Project ->清理... 再次选择您的项目,然后就可以了。

I also had this problem several times and I could 'solve' it by just deleting the messages in the "Problems"-tab and building the project again. Select the project and click on the menu bar Project -> Clean... select your project again and okay.

热情消退 2024-11-15 07:22:20

构建路径中可能已经存在一些已删除的 jar 文件。右键单击项目。 Properties->Java Build Path 并从那里删除了已删除的 jar 文件。

There might be some deleted jar files already in build path. Right click on project. Properties->Java Build Path and removed deleted jar files from there.

美人如玉 2024-11-15 07:22:20

可能有几个原因。大多数时候可能是以下一些原因,

  1. 您已从 /lib 文件夹中删除了一些 .jar 文件
  2. 您添加了新的 .jar 文件
  3. 您添加了可能与其他文件冲突的新.jar文件

因此我们必须解决那些丢失/更新/新添加的jar文件。

  1. 右键单击项目并转到属性
  2. 选择Java Build Path
  3. 转到Libraries选项卡
  4. 删除已删除的 jar 文件的引用已经。它们附近会有一个红色标记,以便您可以轻松识别它们。
  5. 使用添加 JAR 添加对新添加的 .jar 文件的引用
  6. 刷新项目

如果是由于上述原因之一,这将解决问题。

There can be several reasons. Most of the times it may be some of the below reasons ,

  1. You have deleted some of the .jar files from your /lib folder
  2. You have added new .jar files
  3. you have added new .jar files which may be conflict with others

So what to do is we have to resolve those missing / updating / newly_added jar files.

  1. right click on the project and go to properties
  2. Select Java Build Path
  3. go to the Libraries tab
  4. Remove the references of the jar files which you have removed already. There will be a red mark near them so you can identify them easily.
  5. Add the references to the newly added .jar files by using Add JARs
  6. Refresh the project

This will solve the problem if it's because one of the above reasons.

泛滥成性 2024-11-15 07:22:20

这可能是一个构建问题。我的问题是使用 Maven 更新项目(Alt + F5)

This is probably a build problem. What fixed mine was updating the project with maven (Alt + F5)

圈圈圆圆圈圈 2024-11-15 07:22:20

前往
项目->右键单击->属性-> Java 构建路径 ->库

删除所有图标上带有红叉符号的 JAR。

已解决。

Go to
Project -> right click -> properties -> Java Build Path -> Libraries

Delete all the JARs which have red cross symbol on the icon.

Resolved.

眼角的笑意。 2024-11-15 07:22:20

解决方案 1:

步骤:1

右键单击​​您的项目 ->关闭项目。它将关闭您的项目以及该项目的所有打开的文件

步骤:2

右键单击您的项目->打开项目。它将打开您的项目并重建您的项目,希望它能够修复红色感叹号

解决方案2:

步骤1

右键单击您的项目->属性-> Java 构建路径。根据以下屏幕截图,您能否看到库文件前面缺少内容

步骤:2
如果 Jar 文件位于项目的 WEB-INF/lib 中,请单击“添加 Jar”以选择您的 Jar 文件;如果 Jar 文件位于计算机上的某个位置,则单击“添加外部 Jar”

步骤:3
选择旧的丢失文件并单击“删除”
单击此处查看图像

解决方案 3:
右键单击您的项目 ->属性-> Java 构建路径 -> JRE 系统库并重新配置 JRE

,然后转到您的项目并删除项目目录中的 .properties 和 .classpath。

备份您的项目数据并创建一个新项目,然后按照解决方案 1 和 2 进行操作。 2

Solutin 1:

step:1

Right click on your project -> Close Project. it will Close your project and all opened file(s) of the project

step:2

Right click on your project -> Open Project. it will Open your project and rebuild your project, Hope fully it will fix red exclamation mark

Solution 2:

Step:1

Right click on your Project -> Properties -> Java Build Path. Can you see missing in front of your library file(s) as per following screen-shot

Step:2
Click on Add Jar to select your Jar file if it is the placed in WEB-INF/lib of your project or Add External Jar if jar file placed somewhere on your computer

Step:3
Select the old missing file(s) and click on Remove
click here for image

Solutioin 3:
Right click on your Project -> Properties -> Java Build Path -> JRE System Library and reconfigure the JRE

and go to your project and remove .properties and .classpath in your project directories.

backup your project data and create a new one and follow the solutions 1 & 2

不醒的梦 2024-11-15 07:22:20

这很常见,您需要执行以下步骤:

1- 右键单击​​项目

2- 构建路径

3- 配置构建路径

4- 删除已从旧路径移动的 jar/项目

5- 清理项目

6- 构建项目“如果不是自动构建的”

7-使用新位置添加罐子/项目

运行即可!

This is common, you will need to do the following steps:

1- Right click on the project

2- Build path

3- Configure Build Path

4- Remove jars/projects that had moved from their old path

5- clean the project

6- build the project "if not automatically built"

7- Add the jars/projects using their new locations

Run and that is it!

隱形的亼 2024-11-15 07:22:20

我通过以下方式解决了这个问题:

第 1 步: C:/user/rafiq/.m2/repository --> 删除此文件夹

第2步:右键单击您的项目-->maven-->更新maven项目-->仅选中干净的项目-->ok 。

第3步:右键单击您的项目-->maven-->更新maven项目-->选中仅更新项目-->确定。

问题解决了。

I Solved this problem by:

step 1: C:/user/rafiq/.m2/repository --> Delete this folder

Step 2: right click on your project-->maven-->update maven project-->check only clean project-->ok.

Step 3: right click on your project-->maven-->update maven project-->check only update project-->ok.

Problem Solved.

不弃不离 2024-11-15 07:22:20

这意味着您在配置构建路径/向项目添加 jar 时指定的路径中缺少 jar 文件。

只需再次配置 jar 即可。

It means the jar files are missing from the path that you have given while configuring Build Path/adding jars to the project.

Just once again configure the jars.

你的往事 2024-11-15 07:22:20

在 Eclipse 工具中将循环依赖项标记为“警告”,以避免“在构建路径中检测到循环”错误。在 Eclipse 中必须:->窗口 ->首选项 -> Java->编译器->建筑->循环依赖

Mark Circular dependcies as "Warning" in Eclipse tool to avoid "A CYCLE WAS DETECTED IN THE BUILD PATH" error. In Eclipse got to :-> Windows -> Prefereneces -> Java-> Compiler -> Buliding -> Circular Depencies

意中人 2024-11-15 07:22:20

我有一个 Maven 项目给了我同样的东西。它表明它找不到具有该版本(依赖项)的罐子,我知道它在那里并且是正确的 -

所以,对我来说,解决方案是
1 删除本地存储库。
2 清理项目。
3 禁用maven 性质。
4 生成 eclipse 工件并
5.重新配置为maven项目。

(为了)

I had a maven project giving me same thing. It showed that it couldnt find the jar with that version (dependency) and I knew its there and is correct -

So, for me the solution was to
1 delete the local repository.
2 Clean the project.
3 Disable the maven nature.
4 Generate eclipse artifacts and
5 re-configure as maven project.

(in order)

污味仙女 2024-11-15 07:22:20

我关于感叹号的问题出现在以下部分:“右键单击项目文件夹”-“属性”-“库”选项卡。
库上有一个用红色标记的错误,该错误可能不在正确的位置,所以我将其删除。标记消失了。
删除一些旧项目后出现的问题。

My problem concerning exclamation mark was in the section: "right click on project folder" - Properties - Libraries tab.
There was an Error marked in red on a libray that probably wasn't in the right place so I removed it and ex. mark disappeared.
The problem raised after deleting some old projects.

泪痕残 2024-11-15 07:22:20

如果您的 IDE 没有从您提供的路径中找到 JRE。然后您需要在eclipse中手动添加JRE路径以从项目中删除红色感叹号。为此,请按照以下步骤操作:-

转到“属性”>“Java 构建路径”>“库”>单击编辑,

然后选择备用 JRE,然后单击完成。

注意:如果您没有安装Java运行时环境(JRE),请安装。

If your IDE doesn't find JRE from the path you given. Then you manually need to add JRE path in eclipse to remove red exclamation mark from the project. To do this please follow below steps :-

Go to to Properties>Java Build Path>Libraries> Click on Edit

Then Select Alternate JRE and click on Finish.

Note : If you don't have Java Run time Environment (JRE) installed, please install.

初见 2024-11-15 07:22:20

我遇到了同样的问题......实际问题是缺少 .jar 文件,该文件在更改我的工作空间时占据了位置。
我刚刚从新工作区中删除了 appcompat 文件夹(其中包含“.jar”文件),然后从旧工作区中复制了它。
这解决了我的问题。

i was having the same problem....the actual issue was missing .jar file which took palce coz of changing my workspace.
i just deleted the appcompat folder(which has the".jar" file) from my new workspace and copied it from my old workspace.
this solved my problem.

别忘他 2024-11-15 07:22:20

这可能有一个原因,如果一个项目包含库项目,那么您需要首先清理已使用的库项目,然后清理包含该库项目的项目。

This is may for one reason, If a project contains library project then you need to clean first the library project have been used, then clean the project contains that library project.

浴红衣 2024-11-15 07:22:20

出现此问题主要是因为您的库文件被删除。
像以前一样工作项目的简单方法是
1) 转到项目属性
2)选择java构建路径
3)删除除jre之外的所有库。
4) 现在通过单击“添加外部 jar”来添加相同的 jar 文件。

Mainly this problem occurs because your library files get deleted.
The simple way to work your project as it was working previously is
1) Go to Project properties
2) Select java Build Path
3) Remove all library except jre.
4) Now add the same same jar file by clicking "Add external jars".

温折酒 2024-11-15 07:22:20

使用这个简单的步骤右键单击项目 - >属性 - > java构建路径 - >单击 jre 系统库并将其删除,然后单击“添加库”并添加一个新的 jre 系统库来解决该问题!

use this simple steps right click on the project->properties ->java Build path-> click on the jre system library and remove it after that step click on Add library and add a new jre system library that will resolve it!

再浓的妆也掩不了殇 2024-11-15 07:22:20

对于 Maven 项目,从 IDE 中删除项目并运行 maven 命令:-mvn eclipse:clean ,mvn eclipse:eclipse,mvn clean install -e .之后在 IDE 上导入项目。这东西对我有用。

For Maven project delete the project from IDE and run the maven command :-mvn eclipse:clean ,mvn eclipse:eclipse,mvn clean install -e .After this import the project on IDE. This stuff is works for me.

一紙繁鸢 2024-11-15 07:22:20

如果您遇到同样的问题:

  1. 回想一下,如果您更改了用于保存 jar 的位置并将其添加到构建路径中。
  2. 如果您已将项目从一台机器移动到另一台机器,那么您需要右键单击项目->构建路径->配置构建路径。在 Tab Order and Export 中,您将看到 Eclipse 搜索 jar 的位置,只需将其保留在那里并刷新项目即可。
  3. 如果以上方法不起作用,请尝试 Project ->干净。

If you are facing same issue :

  1. Recall , if you have changed the place where you used to keep the jars and add it in build path .
  2. If you have moved your project from one machine to another then you need to right click on project-> Build Path -> Configure Build Path . In Tab Order and export you would see the place where eclipse is searching for jars , just keep it there and refresh the project.
    1. If above things don't work , try Project -> clean .
伪心 2024-11-15 07:22:20

这与本地存储库中相同依赖关系的多个版本有关。m2

转到你的eclipse>问题选项卡>查看错误>转到本地 .m2 文件夹,

删除您最近添加的依赖项的所有不相关版本。

然后尝试重建项目。

This is related to multiple versions of same depenendency in the local repository .m2

go to ur eclipse > problems tab > see the errors > go the local .m2 folder

delete all the non relevant versions of the the dependency which you have added recently.

then try to rebuild the project.

走过海棠暮 2024-11-15 07:22:20

我也遇到过这种奇怪的情况。我所知道的是,早些时候我使用 Spring 版本 1.5.4 运行我的 spring 项目,后来在一个项目中我选择了版本 2.0.1。就在那时我收到了这个错误。当我访问POM并手动将Spring版本更改为1.5.4时,错误消失了。我的猜测是,maven会根据指定的Spring版本下载所需的JAR。如果您更改版本,如果这些 JAR 已经为以前的 Spring 版本下载,并且在 .m2 源文件夹中找到,maven 将不会下载 JAR,如 C: ->;用户-> “登录用户名”-> .m2 路径。

我再次做的是保持 Spring 版本不变(如 2.0.1),我打开了前面所说的问题视图,并通过访问 .m2 文件夹(问题视图中提到了 JAR 的路径)。然后我更新了maven,所有问题都消失了。

这就是我得出的结论,问题出在 .m2 文件夹中为以前的 Spring 版本下载的 JAR 上。

I too faced this strange situation. What I got to know is that, earlier I ran my spring projects with Spring version 1.5.4 and later for one project I chose version 2.0.1. That's when I got this error. When I visited POM and changed Spring version to 1.5.4 manually, the error was gone. What I guess is that, maven downloads the required JARs according to the Spring version specified. If you change the version, maven won't download JARs if those JARs are already downloaded for previous Spring version and found in .m2 source folder found as C: -> Users -> "Logged-In-User-Name" -> .m2 path.

What I did again was to keep the Spring version as it is (as 2.0.1), I opened the Problems view as said earlier and I deleted the JARs which were said as not found in the Problems view by visiting .m2 folder (the Paths were mentioned in the Problems view for were the JARs are). I then updated the maven and all problems were gone.

That's how I conclude that the problem was with JARs which were downloaded for the previous Spring versions in .m2 folder.

站稳脚跟 2024-11-15 07:22:20

如果您更改 selenium-java-3.13.0 文件夹中 jar 的位置,则会出现此 mak。因此,恢复罐子的原始位置即可。

If you change the location of the jars from selenium-java-3.13.0 folder this mak will appear. So restore the original location of the jars and you are go to go.

妄想挽回 2024-11-15 07:22:20

就我而言,这是不正确/不正确的依赖

标记>问题凸显
spring/.gradle/cache/httpcomponents.......pom 不是有效的存档

我删除了

compile group: 'org.apache.httpcomponents', name: 'httpcomponents-client' ,版本:'4.5.6',扩展名:'pom'

更改为

编译组:'org.apache.httpcomponents',名称:'httpclient',版本:'4.5.6'

In my case this is incorrect/improper dependency

Markers > Problems is highlighting
spring/.gradle/cache/httpcomponents.......pom is not valid archive

I removed

compile group: 'org.apache.httpcomponents', name: 'httpcomponents-client', version: '4.5.6', ext: 'pom'

changed to

compile group: 'org.apache.httpcomponents', name: 'httpclient', version: '4.5.6'

挥剑断情 2024-11-15 07:22:20

如果您使用maven pom.xml,请检查您是否使用了poi-ooxml-schemas的依赖项。

当我使用 3.17 版本时,我收到了红色感叹号。更改版本为4.1.2,maven上的红色感叹号消失了。

换句话说,使用更新版本。

If you are using maven pom.xml, then check whether you have used dependency for poi-ooxml-schemas.

I was getting the red exclamation as I was using version 3.17. Changed the version to 4.1.2 and the red exclamation on maven disappeared.

In other words, use an updated version.

罪#恶を代价 2024-11-15 07:22:20

使用“BUILD Path--> LIBRARY --> ADD EXTERNAL JARs”和“remove all”或“selected JAR”删除所有JAR文件。

再次重新安装。

这个动作给我去掉了红色感叹号。

Delete all JAR files using "BUILD Path--> LIBRARY --> ADD EXTERNAL JARs" and "remove all" or "selected JAR".

Reinstall again.

This action removed the red exclamation mark for me.

故人爱我别走 2024-11-15 07:22:20

什么对我有用(到目前为止可能还没有在这里得到答案)::

在处理 Selenium 项目和 ANT 时,我复制了来自 2 个不同源的两个不同的“BUILD.xml”文件并将其放置在项目的 ROOT 目录中。这导致了这个红色感叹号,当我将其中一个 BUILD.xml 文件移动到另一个文件夹时,它就消失了。

至于“为什么我在一个项目中有两个 BUILD.xml 文件?”,我实际上是在使用各种 BUILD.xml 文件中的 ANT 配置。

What worked for me (and probably not yet answered here till now) ::

While working on a Selenium project and ANT, I had copied and placed TWO different "BUILD.xml" files from 2 different sources in the Project's ROOT directory. This resulted in this RED-EXCLAMATION-MARK, which disappeared as soon as I moved one of the BUILD.xml file to another folder.

As to "why I had two BUILD.xml files in ONE project?", I was actually playing around with ANT's config from various BUILD.xml files.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文