eclipse 在解决构建路径错误之前无法构建项目。
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/3632632/
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
The project cannot be built until the build path errors are resolved.
提问by yokks
While compiling an android project in eclipse 3.4.2, I am getting The project cannot be built until the build path errors are resolved.
在 eclipse 3.4.2 中编译 android 项目时,我得到The project cannot be build until the build path errors 解决。
I got a temporary solutionfrom the blog http://www.scottdstrader.com/blog/ether_archives/000921.html
我 从博客http://www.scottdstrader.com/blog/ether_archives/000921.html得到了一个临时解决方案
The resolution was to force a resave of the selected projects (and their .classpath files):
解决方案是强制重新保存所选项目(及其 .classpath 文件):
- Open the project properties
- Select Java Build Path > Libraries
- Add a new, arbitrary library (to be deleted later) > OK
- Wait for the workspace to refresh (or force a refresh of the project)
- The error(s) will go away
- Remove the dummy library
- 打开项目属性
- 选择 Java 构建路径 > 库
- 添加一个新的任意库(稍后删除)> OK
- 等待工作区刷新(或强制刷新项目)
- 错误将消失
- 删除虚拟库
The only other references I could find were to make minor alterations of contents of the .classpath file.
我能找到的唯一其他参考是对 .classpath 文件的内容进行微小改动。
Is there any permanent fix for this issue?
这个问题有没有永久修复?
回答by TK Gospodinov
Have you tried using Project > Clean... from the menu? This will force a new build on the selected projects in Eclipse.
您是否尝试过从菜单中使用 Project > Clean... ?这将强制对 Eclipse 中的选定项目进行新构建。
回答by user2318214
1-Right CLick on your project folder, Choose Build Path > Configure Build Path
2-Select Libraries Tab and delete any arbitrary library present there.
3-Click on Add Library option, Select JRE System Library and click Next.
4-Choose last Radiobutton option Workspace default JRE and click Finish.
5-press f5 for refresh.
6-run ur program .
回答by ThE uSeFuL
This happens when libraries added to the project doesn't have the correct path.
当添加到项目的库没有正确的路径时,就会发生这种情况。
- Right click on your project (from package explorer)
- Got build path -> configure build path
- Select the libraries tab
- Fix the path error (give the correct path) by editing jars or classes at fault
- 右键单击您的项目(来自包浏览器)
- 得到构建路径 -> 配置构建路径
- 选择库选项卡
- 通过编辑错误的 jars 或类来修复路径错误(给出正确的路径)
回答by BustedSanta
This what fixed it for me...
这对我来说是固定的......
I was having an issue with my spring-core.jar. I deleted the entire release directory located here. (I'm on win 10).
我的 spring-core.jar 有问题。我删除了位于此处的整个发布目录。(我赢了 10)。
C:\Users********.m2\repository\org\springframework\spring-core\4.3.1.RELEASE
C:\Users********.m2\repository\org\springframework\spring-core\4.3.1.RELEASE
I right clicked on the project > Maven > Update projectand my exclamation mark disappeared. No problems any more.
我右键单击项目> Maven > 更新项目,我的感叹号消失了。没有问题了。
Here is the source where I found the information:
这是我找到信息的来源:
回答by aimhaj
This works for me: close the projectthen re-open it, this will force eclipse to see it as a fresh project and detects a correct build path.
这对我有用:关闭项目然后重新打开它,这将强制 eclipse 将其视为一个新项目并检测正确的构建路径。
回答by Kevin Workman
None of the other answers worked for me. Even after fixing my build path issues, doing a refresh, clean, rebuild, and restart (of both eclipse and the computer), I was still getting the little red exclamation point.
其他答案都不适合我。即使在修复了我的构建路径问题,进行了刷新、清理、重建和重新启动(eclipse 和计算机)之后,我仍然收到小红色感叹号。
I fixed it by closing the project(right-click, close project) and reopening it(double-click the closed project), which seemed to force eclipse to "notice" that the build path problems had been corrected.
我通过关闭项目(右键单击,关闭项目)并重新打开它(双击关闭的项目)来修复它,这似乎迫使 eclipse“注意到”构建路径问题已得到纠正。
回答by NightFury
For my mac osx Eclipse, I followed following steps:
对于我的 mac osx Eclipse,我遵循了以下步骤:
- Right CLick on your project, Choose Build Path> Configure Build Path
- Select LibrariesTab and delete any arbitrary library or anything else causing errors in Build Path.
- Click on Add Librarybutton, Select JRE System Libraryand click Next.
- Choose last Radiobutton option Workspace default JREand click Finish.
- Clean and build your project.
- 右键单击您的项目,选择构建路径>配置构建路径
- 选择库选项卡并删除任意库或导致构建路径错误的任何其他内容。
- 单击添加库按钮,选择JRE 系统库并单击下一步。
- 选择最后一个 Radiobutton 选项Workspace default JRE并单击 Finish。
- 清理并构建您的项目。
回答by Daniel Winterstein
I've seen this problem a few times (got it again right now on my home computer with Eclipse 4.2).
我已经多次看到这个问题(现在在我的家用电脑上用 Eclipse 4.2 再次遇到它)。
Forcing a resave (by changing the classpath e.g. by adding a library, save, change-back) works temporarily. But the problem comes back when Eclipse is restarted :(
强制重新保存(通过更改类路径,例如通过添加库、保存、改回)暂时起作用。但是当 Eclipse 重新启动时问题又回来了:(
Nuking the Eclipse workspace from orbit will permanently fix it (until next time). But there must be a better way!
从轨道上核 Eclipse 工作区将永久修复它(直到下一次)。但一定有更好的方法!
回答by DamongoCoder
On my Mac this is what worked for me
在我的 Mac 上,这对我有用
- Project > Clean (errors and warnings will remain or increase after this)
- Close Eclipse
- Reopen Eclipse (errors show momentarily and then disappear, warnings remain)
- Project > Clean(在此之后错误和警告将保留或增加)
- 关闭日食
- 重新打开 Eclipse(错误会暂时显示然后消失,警告仍然存在)
You are good to go and can now run your project
你很高兴,现在可以运行你的项目
回答by Vikram3891
This is what worked for me:
这对我有用:
- Go to
~/.m2/repository
and deleted everything there by runningrm -rf
. Make sure everything is deleted. - Re-launch eclipse or STS
- Right click on project -> Maven -> update project.
~/.m2/repository
通过运行转到并删除那里的所有内容rm -rf
。确保所有内容都已删除。- 重新启动eclipse或STS
- 右键单击项目-> Maven -> 更新项目。