Eclipse 中我的项目旁边出现红色感叹号是什么原因?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/6040914/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
What is the reason for a red exclamation mark next to my project in Eclipse?
提问by Darth Blue Ray
回答by Rich
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.
它通常缺少 jar(例如,您的项目配置引用了一个不存在的 jar),而在 JDT 的情况下,这种事情很明显,但如今 Eclipse 可以以多种方式使用,它可以是任何东西。
回答by Vincent Vettukal
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 herefor more details. It is about built error decorater seen in eclipse.
这意味着您的项目中的构建路径存在问题。如果它是一个android项目,那么它主要意味着找不到project.properties文件中指定的目标值。这也可能是由于其他类型的内置问题引起的。但它主要仅针对已构建的问题显示。请参阅此处了解更多详情。它是关于在 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:
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:
在项目中的其他问题中,有时很容易遗漏构建路径问题。Package Explorer 和 Project Explorer 视图现在在包含构建路径错误的 Java 项目和工作集上显示一个新的装饰器:
具体的错误可以在 Problems 视图中看到,如果你打开视图菜单并选择 Group By > Java Problem Type,它们都会显示在 Build Path 类别中:
回答by Qwert
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.
我也多次遇到过这个问题,我可以通过删除“问题”选项卡中的消息并重新构建项目来“解决”它。选择项目并单击菜单栏Project -> Clean...
再次选择您的项目,好的。
回答by W00di
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.
构建路径中可能已经有一些已删除的 jar 文件。右键单击项目。Properties->Java Build Path 并从那里删除已删除的 jar 文件。
回答by prime
There can be several reasons. Most of the times it may be some of the below reasons ,
可能有几个原因。大多数时候可能是以下一些原因,
- You have deleted some of the .jar files from your /lib folder
- You have added new .jar files
- you have added new .jar files which may be conflict with others
- 您已从 /lib 文件夹中删除了一些 .jar 文件
- 您添加了新的 .jar 文件
- 您添加了可能与其他人冲突的新 .jar 文件
So what to do is we have to resolve those missing / updating / newly_added jar files.
那么我们要做的是解决那些丢失/更新/新添加的jar文件。
- right click on the project and
go to properties
- Select
Java Build Path
- go to the
Libraries
tab - 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.
- Add the references to the newly added .jar files by using
Add JARs
- Refresh the project
- 右键单击该项目,然后
go to properties
- 选择
Java Build Path
- 转到
Libraries
选项卡 - 删除已删除的 jar 文件的引用。它们附近会有一个红色标记,因此您可以轻松识别它们。
- 使用以下命令添加对新添加的 .jar 文件的引用
Add JARs
- 刷新项目
This will solve the problem if it's because one of the above reasons.
如果是由于上述原因之一,这将解决问题。
回答by Mehran Hassani
This is probably a build problem. What fixed mine was updating the project with maven (Alt + F5)
这可能是一个构建问题。修复我的是用 maven (Alt + F5) 更新项目
回答by Harshil
Go to Project -> right click -> properties -> Java Build Path -> Libraries
转到项目 -> 右键单击 -> 属性 -> Java 构建路径 -> 库
Delete all the JARs which have red cross symbol on the icon.
删除所有图标上带有红色叉号的 JAR。
Resolved.
解决。
回答by Manoj Krishna
Solutin 1:
解决方案 1:
step:1
第1步
Right click on your project -> Close Project. it will Close your project and all opened file(s) of the project
右键单击您的项目 -> 关闭项目。它将关闭您的项目和项目的所有打开的文件
step:2
第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:
解决方案2:
Step:1
第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
右键单击您的项目 -> 属性 -> Java 构建路径。根据以下屏幕截图,您能看到库文件前面丢失了吗?
Step:2Click 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
步骤:2单击添加 Jar 以选择您的 Jar 文件(如果它位于项目的 WEB-INF/lib 中)或添加外部 Jar(如果 jar 文件位于您的计算机上的某个位置)
Step:3Select the old missing file(s) and click on Remove click here for image
步骤:3选择旧的丢失文件,然后单击“删除” 单击此处查看图像
Solutioin 3:Right click on your Project -> Properties -> Java Build Path -> JRE System Library and reconfigure the JRE
解决方案 3:右键单击您的项目 -> 属性 -> Java 构建路径 -> JRE 系统库并重新配置 JRE
and go to your project and remove .properties and .classpath in your project directories.
并转到您的项目并删除项目目录中的 .properties 和 .classpath 。
backup your project data and create a new one and follow the solutions 1 & 2
备份您的项目数据并创建一个新的并按照 solutions 1 & 2
回答by MoAdel
This is common, you will need to do the following steps:
这很常见,您需要执行以下步骤:
1- Right click on the project
1-右键单击项目
2- Build path
2- 构建路径
3- Configure Build Path
3-配置构建路径
4- Remove jars/projects that had moved from their old path
4-删除从旧路径移动的罐子/项目
5- clean the project
5-清理项目
6- build the project "if not automatically built"
6- 构建项目“如果没有自动构建”
7- Add the jars/projects using their new locations
7- 使用新位置添加 jars/projects
Run and that is it!
运行,就是这样!
回答by otmann
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
在 Eclipse 工具中将循环依赖项标记为“警告”以避免“在构建路径中检测到循环”错误。在 Eclipse 中:-> Windows -> Prefereneces -> Java-> Compiler -> Buliding -> Circular Depencies
Thanks
谢谢