annotation:@Override出现The method of type must override asuperclass解决方案

原因追踪及解决办法:

  1. 查阅资料发现说在jdk1.5下要使用@Override这个annotation必须保证被标注的方法来源于class而不是interface.
  2. 即使自己的jdk是1.6,还需要修改myeclipse里面的编译jdk版本,从1.5(5.0)改成1.6(6.0),否则还会出现上述错误。
  解放办法:在myeclipse下:Windows-Preferences-Java Compiler,在右边的Compiler Compliance Level 修改成1.6(6.0)版本。

此时如果发现还是上述错误

  原因是项目还没有吧jre变成1.6(6.0)

  解决办法:项目右键->build path->configure build path->java Complier(在左边那一排)->右边的Complier compliance level修改为1.6(6.0)版本。

参考:http://www.douban.com/note/228294911/
时间: 2024-08-07 21:19:02

annotation:@Override出现The method of type must override asuperclass解决方案的相关文章

The method of type must override a superclass method解决方式

工程导入myeclipse时,出现问题提示:The method of type must override asuperclass? annotation:@Override的原因 查阅了一下资料,发现说在jdk1.5下要使用@Override 这个annotation 必须保证 被标注方法来源于class 而不是interface, 但我检查过,发现自己的jdk确实是1.6版本啊. 最后发现,即使自己的jdk是1.6,还需要修改myeclipse里面的编译jdk版本,从5.0改成6.0,要不

The method of type must override a superclass method

导入android项目时,报The method of type must override asuperclass method 一堆错误, 解决方法: 将编译的jdk与使用的jdk版本一致即可.

bug2 The method of type must override a superclass method解决方式(去掉@override可以)

@Override 时出错误: 解决办法是: 一.                                                                     因为你的Compiler 是jdk1.5,只要把它改为 1.6 方法: 1. window ->preferences... -> java -> Compiler 2. Compiler compliance level : 6.0 二. 把项目的JRE变成6.0的项目右键->build pat

@Override must override a superclass method 问题解决

如果在使用Eclipse开发Java项目时,在使用 @Override 出现以下错误: The method *** of type *** must override a superclass method 主要是因为你的Compiler是jdk5,(5不支持@Override等形式的批注)只要把它改为6就可以了. 方法:将window->preferences->java-compiler中的Compiler compliance level修改为6.0.

【转】@Override must override a superclass method 问题解决

原文网址:http://www.blogjava.net/anchor110/articles/339352.html 如果在使用Eclipse开发Java项目时,在使用 @Override 出现以下错误:The method *** of type *** must override a superclass method 主要是因为你的Compiler是jdk5,(5不支持@Override等形式的批注)只要把它改为6就可以了.方法:将window->preferences->java-c

@Override must override a superclass method 有关问题解决

1.Java开发环境时 如果在使用Eclipse开发Java项目时,在使用 @Override 出现以下错误: The method *** of type *** must override a superclass method 主要是因为你的Compiler是jdk5,(5不支持@Override等形式的批注)只要把它改为6就可以了. 方法:将window->preferences->java-compiler中的Compiler compliance level修改为6.0. 2.ja

eclise -The method onClick(View) of type new View.OnClickListener(){} must override a superclass method

在做arcgis android开发的时候,突然遇到这种错误,The method onClick(View) of type new View.OnClickListener(){} must override a superclass method. 这看起来确实很奇怪,网上搜了一下,解决方案是将 eclipse制定版本从1.7改为1.6即可. 在 eclipse中,windows->references->java->java compiler中设置.

onClick(View) of type new View.OnClickListener(){} must override a superclass method

原地址:http://blog.csdn.net/aeolus1019/article/details/8014798 Android开发过程中代码错误报错如下: - implements android.view.View.OnClickListener.onClick- The method onClick(View) of type new View.OnClickListener(){} must override a superclass 解决办法: 项目属性——javaCompile

The method convert(String) of type DateConverter must override a superclass method

那是因为你的Compiler 是jdk1.5,只要把它改为 1.6就可以了 方法: j2ee换成 7 The method convert(String) of type DateConverter must override a superclass method