android @override 报错解决方案

现象:

... java: 1801: method does not override a method from its superclass @Override...

原因:

Eclipse is defaulting to Java 1.5 and you have classes implementing interface methods (which in Java 1.6 can be annotated with @Override, but in Java 1.5 can only be applied to methods overriding a superclass method).

就是说Java 1.5的编译器默认对父类的方法进行覆盖,采用@Override进行说明;但1.6已经扩展到对接口的方法;所以如果还是以Java 1.5的编译器来编译的话,会出现错误。

解决方案:

Go to your project/ide preferences and set the java compiler level to 1.6 and also make sure you select JRE 1.6 to execute your program from eclipse.

java的编译器是1.6版本的,选择编译级别为1.6,但重要的一点是,选择build的android库是1.5的即可,生成的apk程序是可以在1.5内核上跑起来。

解决方法:

在eclipse中 选择Window –> Preferences –> Java –> Compiler 选择1.6 ,如果还不可以,在Compiler中选择onfigure Project Specific Settings 选择编译器版本为1.6

时间: 2024-09-20 10:38:20

android @override 报错解决方案的相关文章

android @override 报错解决方案_Android

现象: ... java: 1801: method does not override a method from its superclass @Override... 原因: Eclipse is defaulting to Java 1.5 and you have classes implementing interface methods (which in Java 1.6 can be annotated with @Override, but in Java 1.5 can o

android项目出错-求助,为什么android项目的xml文件的webview标签的android id报错

问题描述 求助,为什么android项目的xml文件的webview标签的android id报错 求助,为什么android项目的xml文件的webview标签的android id报错 解决方案 报什么错,是不是id重复了 解决方案二: 贴出页面可好.凑足十个字 解决方案三: 我感觉你的id重复了,你看看红字是不是两行

数据-android listview 报错 空指针

问题描述 android listview 报错 空指针 这问题 困扰了我3天了 不知道为什么 求大神指点 上代码 这是onCreate里面的 // 商品 listview lv_friend=(ListView) findViewById(R.id.LV_store); adapter=new Myadapter(this, getdatas()); System.out.println("adapter+++++++++++"+adapter); lv_friend.setAdap

图片-Android 这报错是为什么?

问题描述 Android 这报错是为什么? Android 这报错是为什么? 解决方案 Android报错信息android 打包混淆报错问题Android 9.png报错解决 解决方案二: 包引用不正确 com.example.yicaxie 解决方案三: 可是是这个包下的啊 解决方案四: 贴一下你MyApplication.java的代码,可能是调用引起的 解决方案五: 你的路径对不对? MyApplication 没有写入 manifest中吧 解决方案六: public class My

android cts 报错 Android!

问题描述 android cts 报错 Android! 这种报错通常是什么 有没有什么共性 求大虾 指导一下 at com.android.tradefed.testtype.DeviceTestResult$1.protect(DeviceTestResult.java:81) at com.android.tradefed.testtype.DeviceTestResult.runProtected(DeviceTestResult.java:56) at com.android.trad

ubuntu 系统下运行android虚拟机报错如下,怎么回事呢

问题描述 ubuntu 系统下运行android虚拟机报错如下,怎么回事呢 Starting emulator for AVD 'test' X Error of failed request: BadRequest (invalid request code or no such operation) Major opcode of failed request: 154 (GLX) Minor opcode of failed request: 19 (X_GLXQueryServerStr

求大神看看 unity导出android工程报错!!急!!!!

问题描述 求大神看看 unity导出android工程报错!!急!!!! CommandInvokationFailure: Android Asset Packaging Tool failed. See the Console for details. E:adt-bundle-windows-x86_64-20140702sdkbuild-tools21.1.1aapt.exe package -v -f -F raw.ap_ -A raw -0 """" s

android应用-新建android工程 报错,大神看过来

问题描述 新建android工程 报错,大神看过来 [2015-06-21 09:40:53 - HellowWord] F:eclipse 32workspaceHellowWordresvaluesstyles.xml:7: error: Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light'. [2015-06-21 09:40:53 -

android-网上的方法都试过了,软件也重装了,Android studio 报错,求解决,在线等..

问题描述 网上的方法都试过了,软件也重装了,Android studio 报错,求解决,在线等.. Error:Unable to start the daemon process. This problem might be caused by incorrect configuration of the daemon. For example, an unrecognized jvm option is used. Please refer to the user guide chapter