admin管理员组文章数量:1636920
出现问题提示:The method xxx of type must override or implement a supertype? 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
按照以上改了,还是有红色叉号,还是报错,怎么办,
再把文件从窗口上先叉掉,再重新打开就不会报错了。
转载于:https://wwwblogs/mengjinluohua/p/5225681.html
本文标签: xxxmethodMyEclipsetypesupertype
版权声明:本文标题:myeclipse中出现The method xxx of type must override or implement a supertype 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:https://www.elefans.com/dianzi/1729234185a1191802.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论