eclipse Android:无法解析 java.lang.Enum 类型
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/5293110/
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
Android: The type java.lang.Enum cannot be resolved
提问by Android Eve
I downloaded Android's Browser project (from git) and imported it to Eclipse. I cannot build it however because of the following error:
我下载了 Android 的浏览器项目(来自 git)并将其导入 Eclipse。但是,由于以下错误,我无法构建它:
The type java.lang.Enum cannot be resolved. It is indirectly referenced from required .class files
无法解析 java.lang.Enum 类型。它是从所需的 .class 文件间接引用的
Now... this is a development environment that has been working very well for other projects:
现在……这是一个对其他项目运行良好的开发环境:
- Windows 7 Ultimate 64-bit.
- JDK 64-bit (jdk-6u23-windows-x64.exe installed.)
- Eclipse Classic 3.6 64-bit (eclipse-SDK-3.6.1-win32-x86_64.zip)
- Android 2.3 SDK Starter Package
- Windows 7 Ultimate 64 位。
- JDK 64 位(安装了 jdk-6u23-windows-x64.exe。)
- Eclipse Classic 3.6 64 位 (eclipse-SDK-3.6.1-win32-x86_64.zip)
- Android 2.3 SDK 入门包
So I am not sure where the problem could lie.
所以我不确定问题可能出在哪里。
How do I solve this?
我该如何解决这个问题?
回答by CommonsWare
At best, your build path is messed up. Right-click over the project name, and choose Build Path > Configure Build Path from the context menu. This brings up the build path portion of the project properties window, on the "Order and Export" tab. If the Android JAR is not checked, check it, then close the properties window.
充其量,您的构建路径一团糟。右键单击项目名称,然后从上下文菜单中选择构建路径 > 配置构建路径。这会在“订购和导出”选项卡上显示项目属性窗口的构建路径部分。如果未选中 Android JAR,请选中它,然后关闭属性窗口。
At worst, you are trying to build this project purely from the SDK, which is unlikely to work, because few of the AOSP apps are designed to be built outside of the full firmware build.
最坏的情况是,您试图完全从 SDK 构建这个项目,这不太可能奏效,因为很少有 AOSP 应用程序设计为在完整固件构建之外构建。
回答by Macarse
It's not an android issue, it's an eclipse issue.
这不是安卓的问题,是日食的问题。
Check:
查看:
回答by user1428735
I upgrade from JDK 1.6.0_24 to 1.6.0_32and the problem is gone :)
我从JDK 1.6.0_24升级到 1.6.0_32,问题消失了:)