您的位置:首页 > 其它

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

2015-11-26 10:02 435 查看
http://linhfgo.iteye.com/blog/1470996

工程导入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,要不就会出现上述错误

修改路径是,在myeclipse下:Windows--Preferences--Java--Compiler,在右边的Compiler
compliance level 修改版本为 6.0,就可以了    {Windows->Preferences->Java->Compiler  “configure
project specific

settings”,
Change from java 1.5 (5.0) to 1.6 (6.0) and then “yes” rebuild project。  这个要详细些,其实 跟前面一样}

 

此时,会发现 做了上面步骤,为啥还要报错,那是因为 导入的项目,还没把jre 变为6.0,解决办法为:项目右键->build path->configure build path->java Compiler(左边那排中) ->在右边的Compiler
compliance level 修改版本为 6.0

 

 
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: