Eclipse 中的红色感叹号图标是什么意思?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/5640823/
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 does the red exclamation point icon in Eclipse mean?
提问by Pops
What does the red exclamation point icon in Eclipse mean? There are lots of different search results on the Internet about "red exclamation point icons" and "red exclamation mark decorators" and "red bang icons," no doubt because lots of plugins and programming-related tools use red exclamation point icons. So, to be clear, this is the one I mean:
Eclipse 中的红色感叹号图标是什么意思?网上关于“红色感叹号图标”、“红色感叹号装饰器”和“红色爆炸图标”的搜索结果很多,这无疑是因为很多插件和编程相关的工具都使用红色感叹号图标。所以,要清楚,这就是我的意思:
It appears as a decorator on projects in the Package Explorer view.
它在 Package Explorer 视图中显示为项目的装饰器。
In my case, the icon went away when a missing build path variable was filled in. I'm using MyEclipse 9.0, but I don't think this is MyEclipse-specific. Other people on the Internet have reported that it has to do with other issues, including Subclipse, the .svn
folder and moving files between working copies.
就我而言,当填充缺失的构建路径变量时,图标消失了。我使用的是 MyEclipse 9.0,但我认为这不是 MyEclipse 特定的。互联网上的其他人报告说,这与其他问题有关,包括 Subclipse、.svn
文件夹和在工作副本之间移动文件。
回答by ZoogieZork
According to the documentation:
根据文档:
Decorates Java projects and working sets that contain build path errors
修饰包含构建路径错误的 Java 项目和工作集
In practice, I've found that a "build path error" may be caused by any number of reasons, depending on what plugins are active. Check the "Problems" view for more information.
在实践中,我发现“构建路径错误”可能由多种原因引起,具体取决于哪些插件处于活动状态。查看“问题”视图以获取更多信息。
回答by yogishaj
I also faced a similar problem when i tried to import Source file and JAR file from one machine to another machine. The path of the JAR was different on new machine compared to old machine. I resolved it as belows
当我尝试将源文件和 JAR 文件从一台机器导入到另一台机器时,我也遇到了类似的问题。与旧机器相比,新机器上的 JAR 路径不同。我解决了它如下
- Right click on the "Project name"
- Select "Build path"
- Then select "Configure Build Path"
- Click on "Libraries"
- Remove all the libraries which were referring to old path
- 右键单击“项目名称”
- 选择“构建路径”
- 然后选择“配置构建路径”
- 点击“图书馆”
- 删除所有引用旧路径的库
Then, the exclamation symbol on the "Project name" was removed.
然后,删除了“项目名称”上的感叹号。
回答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:
在项目中的其他问题中,有时很容易遗漏构建路径问题。Package Explorer 和 Project Explorer 视图现在在包含构建路径错误的 Java 项目和工作集上显示一个新的装饰器:
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:
具体的错误可以在 Problems 视图中看到,如果你打开视图菜单并选择 Group By > Java Problem Type,它们都会显示在 Build Path 类别中:
回答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 jar file references 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 Steve Hansen Smythe
I found another scenario in which the red exclamation mark might appear. I copied a directory from one project to another. This directory included a hidden .svn directory (the original project had been committed to version control). When I checked my new project into SVN, the copied directory still contained the old SVN information, incorrectly identifying itself as an element in its original project.
我发现了另一种可能出现红色感叹号的情况。我将一个目录从一个项目复制到另一个项目。该目录包含一个隐藏的 .svn 目录(原始项目已提交给版本控制)。当我将我的新项目检入 SVN 时,复制的目录仍然包含旧的 SVN 信息,错误地将自己标识为原始项目中的一个元素。
I discovered the problem by looking at the Properties for the directory, selecting SVN Info, and reviewing the Resource URL. I fixed the problem by deleting the hidden .svn directory for my copied directory and refreshing my project. The red exclamation mark disappeared, and I was able to check in the directory and its contents correctly.
我通过查看目录的属性、选择 SVN 信息并查看资源 URL 发现了问题。我通过删除我复制的目录的隐藏 .svn 目录并刷新我的项目来解决这个问题。红色感叹号消失了,我可以正确地签入目录及其内容。
回答by TennFest
What I did was peculiar but somehow it fixed the problem. Pick any project and perform a fake edit of the build.properties file (e.g., add and remove a space and then save the file). Clean and rebuild the projects in your workspace.
我所做的很奇怪,但它以某种方式解决了问题。选择任何项目并对 build.properties 文件进行虚假编辑(例如,添加和删除一个空格,然后保存该文件)。清理并重建工作区中的项目。
Hope this solve some of your problems.
希望这可以解决您的一些问题。
回答by user1163441
The solution that worked for me is the following one given by Steve Hansen Smythe. I am just pasting it here. Thanks Steve.
对我有用的解决方案是 Steve Hansen Smythe 给出的以下解决方案。我只是把它贴在这里。谢谢史蒂夫。
"I found another scenario in which the red exclamation mark might appear. I copied a directory from one project to another. This directory included a hidden .svn directory (the original project had been committed to version control). When I checked my new project into SVN, the copied directory still contained the old SVN information, incorrectly identifying itself as an element in its original project.
“我发现了另一种可能出现红色感叹号的场景。我将一个目录从一个项目复制到另一个项目。该目录包含一个隐藏的 .svn 目录(原始项目已提交到版本控制)。当我检查我的新项目时进入 SVN,复制的目录仍然包含旧的 SVN 信息,错误地将自己标识为原始项目中的一个元素。
I discovered the problem by looking at the Properties for the directory, selecting SVN Info, and reviewing the Resource URL. I fixed the problem by deleting the hidden .svn directory for my copied directory and refreshing my project. The red exclamation mark disappeared, and I was able to check in the directory and its contents correctly."
我通过查看目录的属性、选择 SVN 信息并查看资源 URL 发现了问题。我通过删除我复制的目录的隐藏 .svn 目录并刷新我的项目来解决这个问题。红色感叹号消失了,我可以正确签入目录及其内容。”
回答by Terence
I had the same problem and Andrew is correct. Check your classpath variable "M2_REPO". It probably points to an invalid location of your local maven repo.
我有同样的问题,安德鲁是对的。检查您的类路径变量“M2_REPO”。它可能指向您本地 Maven 存储库的无效位置。
In my case I was using mvn eclipse:eclipse
on the command line and this plugin was setting the M2_REPO classpath variable. Eclipse couldn't find my maven settings.xml in my home directory and as a result was incorrectly the M2_REPO classpath variable. My solution was to restart eclipse and it picked up my settings.xml and removed the red exclamation on my projects.
在我的例子中,我mvn eclipse:eclipse
在命令行上使用,这个插件正在设置 M2_REPO 类路径变量。Eclipse 在我的主目录中找不到我的 maven settings.xml,结果是 M2_REPO 类路径变量不正确。我的解决方案是重新启动 eclipse,它选择了我的 settings.xml 并删除了我的项目中的红色感叹号。
I got some more information from this guy: http://www.mkyong.com/maven/how-to-configure-m2_repo-variable-in-eclipse-ide/
我从这个人那里得到了更多信息:http: //www.mkyong.com/maven/how-to-configure-m2_repo-variable-in-eclipse-ide/
回答by An???drew
Make sure you don't have any undefined classpath variables (like M2_REPO).
确保您没有任何未定义的类路径变量(如 M2_REPO)。
回答by Naresh Kumar
The solution that worked for me is the following one given..
对我有用的解决方案是以下给出的解决方案..
I selected the particular project> right click >Build path>configure Build path> Libraries> I noticed that JRE system Library was showing(Unbound) hence..
我选择了特定项目>右键单击>构建路径>配置构建路径>库>我注意到JRE系统库显示(未绑定)因此..
selected that Library>click on Remove>click on Apply>click on add Library>JRE system Library>next>workspace default JRE>click on Finish>Apply>ok.
选择该库>单击删除>单击应用>单击添加库>JRE系统库>下一步>工作区默认JRE>单击完成>应用>确定。
now you will not see these exclamation icon in your project.
现在您将不会在您的项目中看到这些感叹号图标。