Remove @Override annotration解决

Michael Myers Nov 19 '10 at 15:17

This question is protected to prevent "thanks!", "me too!", or spam answers by new users. To answer it, you must have earned more than 10 reputation on this site.

5 Answers

activeoldestvotes


up vote275down voteaccepted

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).

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.


link|improve this answer

answered Nov 5 '09 at 3:33

alphazero
7,25211010


Thank you so much, never would have figured that out! – Tim H Nov 5 '09 at 4:02

Happy to help. Been bitten by the same myself ;) – alphazero Nov 5 '09 at 4:28

+1 for short and clear answer. – OemerA Oct 12 '10 at 8:38

Same issue here, thanks, great answer. – DavidG Dec 28 '10 at 15:54
2  

My project was set to 1.6, so I shot for the stars and set it to 1.5, rebuilt, then back to 1.6. Miraculously this resolved my issue. Thanks for pointing me in the right direction! – Michael Krauklis Feb 9 '11 at 20:43

show 6 more comments

feedback


up vote65down vote

With Eclipse Galileo you go to Eclipse -> Preferences menu item, then select Java and Compiler in the dialog.

Now it still may show compiler compliance level at 1.6, yet you still see this problem. So now select the link "Configure Project Specific Settings..." and in there you'll see the project is set to 1.5, now change this to 1.6. You'll need to do this for all affected projects.

This byzantine menu / dialog interface is typical of Eclipse's poor UI design.


link|improve this answer

answered Sep 8 '10 at 3:48

Paul
1,442411


+1 - this was driving me crazy. – I82Much Sep 8 '10 at 17:10

+1 Good followup. I wish the answers were consolidated. – Justin Nov 18 '10 at 12:43
3  

+! excellent supplement to the above answer – Anand Jan 21 '11 at 10:54

Great stuff! Thanks – m6tt Nov 19 '11 at 23:42

feedback


up vote5down vote

In case this happens to anyone else who tried both alphazero and Paul's method and still didn't work.

For me, eclipse somehow 'cached' the compile errors even after doing a Project > Clean...

I had to uncheck Project > Build Automatically, do a clean and build again.


link|improve this answer

answered Jan 26 '11 at 17:22

Rollin_s
31337

欢迎加群互相学习,共同进步。QQ群:iOS: 58099570 | Android: 330987132 | Go:217696290 | Python:336880185 | 做人要厚道,转载请注明出处!http://www.cnblogs.com/sunshine-anycall/archive/2012/01/06/2315058.html

时间: 2024-10-01 05:25:17

Remove @Override annotration解决的相关文章

fragment+viewpager可以运行,但是会报一个错误

问题描述 fragment+viewpager可以运行,但是会报一个错误 50C 我用framement+viewpager做了三个页面的切换,调试之后在手机上可以运行,但是每次切换界面都会报如下错误 moveToState: Fragment state for CustomerInf{55de94e #1 id=0x7f0c005d android:switcher:2131492957:0} not updated inline; expected state 3 found 2 其中粗体

[Android]Android MVP&依赖注入&单元测试

以下内容为原创,欢迎转载,转载请注明 来自天天博客:http://www.cnblogs.com/tiantianbyconan/p/5422443.html Android MVP&依赖注入&单元测试 注意:为了区分MVP中的View与Android中控件的View,以下MVP中的View使用Viewer来表示. 这里暂时先只讨论 Viewer 和 Presenter,Model暂时不去涉及. 1.1 MVP 基础框架 1.1.1 前提 首先需要解决以下问题: MVP中把Layout布局

JMagick实现基本图像处理的类实例

  本文实例讲述了JMagick实现基本图像处理的类.分享给大家供大家参考.具体分析如下: JMagick是一个开源API,利用JNI(Java Native Interface)技术实现了对 ImageMagick API的Java访问接口,因此也将比纯Java实现的图片操作函数在速度上要快. ? 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36

Codis作者黄东旭:细说分布式Redis架构设计和那些踩过的坑

Codis是一个分布式Redis解决方案,与官方的纯P2P模式不同,Codis采用的是Proxy-based的方案.今天我们介绍一下Codis以及下一个大版本RebornDB的设计,同时会介绍Codis在实际应用场景中的一些tips.最后抛砖引玉,介绍一下我对分布式存储的一些观点和看法. 目录 Redis.RedisCluster和Codis 我们更爱一致性 Codis在生产环境中的使用的经验和坑们 对于分布式数据库和分布式架构的一些看法 答疑记录 1Redis,RedisCluster和Cod

2016头条校招笔试题(LRU)算法之JAVA实现

操作系统中可以使用LRU(Least Recently Used)内存淘汰旧数据的策略,如果内存需要加载新数据但空间不足,则会按照最近访问时间进行排序,并将最老的数据淘汰.假设现在内存空间大小为5,原本内存中没有数据,对内存中数据的访问顺序如下:1, 2, 5, 3, 4, 6,1, 4, 3, 6, 7, 8, 3, 9 问访问过程中发生缺页的次数是多少次?  JAVA实现: 首先实现一个固定长度的集合队列 package com.itstyle.list; import java.util.

spring 多数据源 ,mybatis和hibernet版本

mybatis版本 1.数据源配置: jdbc_multiple.properties: # MySQL #============================================================================ jdbc.mysql.driver=com.mysql.jdbc.Driver jdbc.mysql.url=jdbc:mysql://127.0.0.1:3306/test?useUnicode=true&characterEncodi

实现一个固定长度的集合队列

在开发中,有时候我们会遇到这样的需求: 对一个集合操作,提前为集合指定最大大小,在我们不断向集合中添加数据的时候,当数据内容超过最大值的时候,自动将最先入队的元素移除队列. 实现方法很简单,代码如下 package com.test.limitqueue; import java.util.Collection; import java.util.Iterator; import java.util.LinkedList; import java.util.Queue; /** * 实现一个固定

5.1、雨滴游戏的扩展

在本教程中我们将对雨滴游戏进行扩展.我们将尝试添加一个菜单和其他的一些功能. (前一篇文章:点击进入) ** Screen接口** Screen对于任何游戏都是基本的,Screen包含很多来自ApplicationListener对象的方法,但包含两个新的方法:show和hide.用来获得或失去焦点. ** Game类** Game类提供来继承自ApplicationListener的接口供使用,同时提供了一些方法用来设置和控制Screen渲染. 通过使用Screen和Game对象,可以创建一个

Java简单实现SpringMVC+MyBatis分页插件_java

1.封装分页Page类 package com.framework.common.page.impl; import java.io.Serializable; import com.framework.common.page.IPage; /** * * * */ public abstract class BasePage implements IPage, Serializable { /** * */ private static final long serialVersionUID