ITeye博客

Eclipse Indigo @Override 报错

YYZhQ · 2012-05-03 10:33 · Markdown

用Eclipse Indigo导入项目文件,发现报错,一看错误地方,全是@Override,说其只能注解复写超类的代码,不解,网上查,发现一段解答如下:

The @Override annotation spec changed in Java 1.6. In Java 1.5, the compiler did not allow the @Override annotation on implemented interface methods, but in 1.6 it does.

看引用JRE的包,确实是1.5的,改为1.6,红叉叉消失了。原来java 1.5 @Override注解不允许加注到接口方法的实现上,而1.6就改了。

http://stackoverflow.com/questions/2335655/why-is-javac-failing-on-override-annotation

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。