Java Eclipse 显示错误,但我找不到它们
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/3812987/
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
Eclipse shows errors but I can't find them
提问by JonniBravo
I am trying to run my project but eclipse is saying I have errors but there are no errors just a red cross where the project name is. I have tried deleting the R.java and generating a new one but that didnt work
我正在尝试运行我的项目,但 eclipse 说我有错误,但没有错误,只是项目名称所在的红叉。我试过删除 R.java 并生成一个新的,但没有用
Thanks In Advance
提前致谢
采纳答案by Mike G
Based on the error you showed ('footballforum' is missing required Java project: 'ApiDemos'), I would check your build path. Right-click the footballforum project and choose Build Path > Configure Build Path. Make sure ApiDemos is on the projects tab of the build path options.
根据您显示的错误('footballforum' 缺少必需的 Java 项目:'ApiDemos'),我会检查您的构建路径。右键单击footballforum 项目并选择Build Path > Configure Build Path。 确保 ApiDemos 位于构建路径选项的项目选项卡上。
回答by Fortega
Take a look at
看一眼
Window → Show View → Problems
or
或者
Window → Show View → Error Log
回答by dxh
This happens from time to time in Eclipse. In the "Project" menu there's a "Clean" option, that usually takes care of the problem.
这在 Eclipse 中不时发生。在“项目”菜单中有一个“清理”选项,通常可以解决问题。
回答by Dan
Ensure you have Project | Build Automatically flagged. I ran into this issue too and turning that on fixed the problem.
确保您有项目 | 构建自动标记。我也遇到了这个问题,打开它解决了这个问题。
回答by Dan
Go to project>clean
and select the project which display error from check box and click ok , it will clear the error for you.
Click the tab which display build automatically in the project menu
And if this also does not work than restart the eclipse and try again it will work.
转到project>clean
并从复选框中选择显示错误的项目,然后单击确定,它将为您清除错误。单击项目菜单中自动显示构建的选项卡如果这也不起作用,则重新启动 eclipse 并重试它会起作用。
回答by OnDWay
I just removed all the private libraries in JavaBuildPath and added the jars again.. It worked
我刚刚删除了 JavaBuildPath 中的所有私有库,并再次添加了 jars ..它起作用了
回答by Lance Kind
For me, this happens with Maven and Eclipse/STS whenever I update my IDE or import an existing Maven project. Go to the "Problems tab" (Window-> Show View-> Problems) and see what it says. Recently, the problems tab showed Project configuration is not up-to-date ...
and suggested that I use Maven to update my project configuration, and this solved the "red X" problem. To do this, in the "Project Explorer" view, trigger the context menu and select Maven-> Update Project, as seen in this screenshot snippet:
对我来说,每当我更新 IDE 或导入现有的 Maven 项目时,Maven 和 Eclipse/STS 都会发生这种情况。转到“问题选项卡”(窗口->显示视图->问题),看看它说了什么。最近,问题选项卡显示Project configuration is not up-to-date ...
并建议我使用Maven更新我的项目配置,这解决了“红X”问题。为此,在“项目资源管理器”视图中,触发上下文菜单并选择Maven->更新项目,如下面的截图片段所示:
回答by Nakesh
If you see the error in problem panel it will say : Description Resource Path Location Type Project configuration is not up-to-date with pom.xml. Select: Maven->Update Project... from the project context menu or use Quick Fix.
如果您在问题面板中看到错误,它会说:描述资源路径位置类型项目配置不是最新的 pom.xml。从项目上下文菜单中选择:Maven->Update Project... 或使用 Quick Fix。
Solution : Right click on project > select : Maven->Update Project
解决方案:右键单击项目>选择:Maven->更新项目
Error gone.
错误消失。
回答by Venkata Ramana
I came across the same issue while working on a selenium project(maven). The Project folder and pom.xml were showing red cross symbol. This was coming as i had the test datasheet open. I could remove the error by just closing the datasheet and the never faced the issue again
我在处理硒项目(maven)时遇到了同样的问题。Project 文件夹和 pom.xml 显示红色十字符号。这是因为我打开了测试数据表。我可以通过关闭数据表来消除错误,并且再也没有遇到过这个问题
回答by sourabh modi
Right Click on Project -> Build Path -> Configure Build Path. Check if Maven Dependencies is there in list, if not then update maven project by Right Click on Project -> Maven -> Update Project
右键单击项目 -> 构建路径 -> 配置构建路径。检查列表中是否存在 Maven 依赖项,如果没有,则通过右键单击项目 -> Maven -> 更新项目来更新 Maven 项目