该项目未构建,因为其构建路径不完整
每次我尝试将从 googlecode 下载的项目导入到 Eclipse 中时,都会遇到一些错误:
该项目未构建,因为其构建路径不完整。不能 找到 java.lang.Object 的类文件。修复构建路径然后尝试 构建这个项目
无法解析目标“android-10”(从 1 更改为 15)
我已经检查了网站上的其他答案,但没有解决方案有效。
在
属性-> Java 构建路径 ->图书馆
有 1 项:
无法获取项目的系统库
Every time I try to import a project downloaded from googlecode into Eclipse but I get some errors:
The project was not built since its build path is incomplete. Cannot
find the class file for java.lang.Object. Fix the build path then try
building this projectUnable to resolve target 'android-10' (this changes from 1 to 15)
I've already checked the other answers on the site but no solution worked.
In
Properties -> Java Build Path -> Libraries
there's 1 item:
Unable to get system libraries for the project
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(18)
转到 eclipse → 首选项 → Java → 构建路径。
您是否看到那里配置了
JRE_LIB
?如果没有,请从JDK/jre
lib
位置添加JRE_LIB
。这些可以在每个项目中被覆盖。看来你的 eclipse 不知道 Java 库。Goto eclipse → Preferences → Java → Build path.
Do you see a
JRE_LIB
configured there? If not, addJRE_LIB
fromJDK/jre
lib
location. These can be overridden per project. It seems your eclipse isn't aware of Java libraries.我过去在 Eclipse 中导入项目时见过这样的错误。解决方案是转到属性 -> Android 并适当选择项目构建目标(Android xxx 或 Google API)
I have seen such errors in past while importing projects in eclipse. The solution to that is to go to properties->Android and select project build target appropriately (Android x.x.x or Google APIs)
今天在尝试加载 Vuforia 示例应用程序时遇到了这个问题,时间太长了。最终构建我的项目的解决方案是:
1) Window->Android SDK Manager 并安装最新更新
2) Project->Build Path->Configure Build Path->Android 并在 Project Build Target 下标记 Android 4.4.2 并单击 OK
3) 清理、构建和运行
我希望这也能解决其他人的问题,Eclipse 令人沮丧,F$#@!!!
Was struggling with this while trying to load the Vuforia Sample App for way too long today. The solution that finally got my project to build was:
1) Window->Android SDK Manager and Install the latest updates
2) Project->Build Path->Configure Build Path->Android and under Project Build Target mark Android 4.4.2 and click OK
3) Clean, Build and Run
I hope this solves somebody else's issue as well, Eclipse is frustrating as F$#@!!!
我遇到了类似的问题......
确保
如果第一步很清楚,那么就这样做吧......
I encountered with the similar problem.....
Make sure that
If the first step is clear, then go for this.....
我也遇到过类似的问题。完全相同的错误,但在我从 Windows 的 dropbox 文件夹中处理项目后,在 Ubuntu 中出现了错误。
我刚刚将 android.jar 添加到项目中。不知何故它从构建路径中消失了。
I've had similar problem. Exact same error, but in Ubuntu after I worked on project in dropbox folder from Windows.
I've just added android.jar to project. Somehow it disappeared from build path.
对我来说,这个问题与 Ubuntu 上的 OpenJDK 6 有关。
更新您的 JRE 或安装 Sun 专有的 JRE,然后重新启动 Eclipse。
For me this problem was related to OpenJDK 6 on Ubuntu.
Update your JRE or install Sun's proprietary JRE instead and restart Eclipse.
我知道这已经太晚了。但我也面临这个问题,我通过以下步骤解决了这个问题。
问题已修复。我认为这是因为如果您使用更高的 JDK 版本构建项目,那么您应该使用相同的版本构建。
注意:直到我的同事使用 JDK 1.7 构建之前,我们才遇到这个问题。在他开始使用 JDK 1.7 后,才出现这个问题。
希望它对某人有用。并且无需安装新的 eclipse。
I know this is too late. but I am also facing this issue and I fix this by following below steps.
Finally issue is fixed. I think this is because of If you build your project with higher JDK version thereafter you should build with same version.
NOTE : we are not facing this issue before until my colleague build with JDK 1.7. After he started to using JDK 1.7 only this issue occur.
Hope it will work for some one. And no need for install new eclipse.
我在“项目”中关闭了“自动构建”。我将其关闭,因为由于各种未知原因,Eclipse 没有正确加载项目。打开这个,解决了我的问题。
I had my "Build Automatically" turned off in "Project". I turned it off, because the Eclipse was not loading the projects correctly, for various unknown reasons. Turning this on, solved my problem.
如果项目不是很大,您可以复制包并将其粘贴到新项目中,您不会在新项目中看到错误。
if the project is not very big, you can copy the packages and paste it into a new project, you won't see the errors in the new project.
我的project.properties 中有target-18。但我没有 android-18 sdk。所以我将 18 更改为 SDK 管理器中的其他版本,它解决了问题。
I was having target-18 in my project.properties. But I wasn't having android-18 sdk. So I changed 18 to some other version which I had in my SDK manager, and it fixed the issue.
您只需退出 eclipse 一次或两次即可重新加载。这对我有用。
You just exit eclipse once or twice to reload. It works for me.
史蒂夫的答案确实对某些项目有帮助,但对于某些项目来说,它仍然保持不变。我猜这些项目之前是内置于早期 JDK 1.5 中的(就我而言)。但我找到了解决方法:
import
块之后复制类的内容。AndroidManifest.xml
中)。Steve's answer does help for some projects, but still, for some projects, it remains the same. I guess that projects were previously build-in early JDK 1.5 (in my case). But I found a workaround for them:
import
block.AndroidManifest.xml
).我必须删除
gen
文件夹中的R.java
,然后进行干净的构建。这解决了我的问题。I had to delete
R.java
in thegen
folder, then do a clean build. This solved my issue.右键单击项目->属性-> Java 构建路径(从左侧列表开始)->库(选项卡)->添加库(右侧按钮)-> JRE系统库->下一步->工作区默认 JRE ->完成
这应该至少可以解决您的一个错误。任何其他可能需要您添加更多库。
Right click on project -> Properties -> Java Build Path (From Left List) -> Libraries (Tab) -> Add Library (Button on right) -> JRE System Library -> Next -> Workspace default JRE -> Finish
This should solve at least one of your errors. Any others might require you to add further libraries.
关闭 eclipse 并重新打开对我有用。您可能需要执行此操作两到三次。每次给它一分钟的时间来完成自动构建启动过程(检查右下角),因为这些错误通常会在此时消失。
或者尝试清理受影响的项目。
“将其关闭并再次打开”
Close eclipse and re-open worked for me. You may have to do this two or three times. Each time give it a minute for the auto build startup process (check bottom right hand corner) to complete, as these errors often disappear at this time.
Or try to clean the affected projects.
'Turn it off and on again'
看来你缺少JDK(java.lang.Object来自那里)
问题是你在不同的PC上使用了相同的Android API。 Eclipse 会因为路径名不同但 API 相同而丢失。
要解决这个问题,首先重新选择 Android API 版本(设置为另一个版本并有效,然后恢复您想要的版本并验证它 -> 这将强制 Eclipse 重新加载 API)。
然后进入项目->属性-> java 构建路径。然后删除“无法获取项目的系统库”,然后删除“添加库”并选择“Android Classpath 容器”。
It seems that you lack JDK (java.lang.Object comes from there )
The problem is that you used the same Android API on different PC. Eclipse is lost with path names that are differents but with same API.
To solve it, first re-select Android API version (set to another one and valid, then restore the on you want and validate it -> it will force Eclipse to reload API).
Then go into project->properties-> java build path. Then remove "Unable to get system library for the project" then "Add library" and select "Android Classpath container".
最初我试图从github导入一个android项目,遇到了上述问题
无法配置构建路径
无法获取系统库
注意:还可以尝试“清理”(在 Windows 上:“项目”->“清理”),然后随机刷新 (F5)。这很有可能神奇地解决您所有的问题。
礼貌:凯尔·克莱格
参考链接
Initially I was trying to import an android project from github and encountered the above problem
cannot configure build path
unable to get system libraries
Note: Also try Clean (On Windows: Project -> Clean) then Refresh (F5) at random. There's a good chance this will magically solve all your problems.
courtesy: KYLE CLEGG
reference link
这些都不适合我。我为项目创建了一个新的工作区。这对我有用!切换到新的工作空间通常会奇迹般地解决许多此类配置问题。只需在您想要放置新工作区的位置创建一个新文件夹,然后使用“从现有代码导入项目”即可。
None of this worked for me. I created a new workspace for the projects. That worked for me! Switching to a new workspace usually miraculously solves a lot of these configuration problems. Simply create a new folder where you would want your new workspace to be and then use 'import project from existing code'.