Eclipse 报错The method xxx of type must override a superclass methodDescription Resource Path Locati
Posted 弓长张&木子李
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Eclipse 报错The method xxx of type must override a superclass methodDescription Resource Path Locati相关的知识,希望对你有一定的参考价值。
问题:
如上图, 没改钱@Override会报错The method run() of type must override a superclass method
原因:
java1.5中继承接口是不需要@Override的,而在1.6中是需要添加@Override注解的
解决:
解决此问题的办法是修改java编译器的版本,方法是:elicpse的Project菜单 --> Properties --> 找到Java Compiler将Compiler Compliance level修改为1.5以上版本即可
解决完成后可能还回有Description Resource Path Location Type Java compiler level does not match the version of the installed Java project facet的错误
原因:
eclipse/myeclipse的jdk编译版本与出现问题的项目JDK编译版本不一致
解决:
1、进入 windows---proferences---java--compiler设置编译出来的文件使用的格式是 1.8版本的 (设置成多少都行,只要兼容,并且与你项目的编译版本一直就可以,我这里统一设置成1.8)
因为我的jdk是1.8的所以选择1.8
2、右键项目--properties---java Compiler 把项目编译版本也设置成 1.8
3、右键项目--properties---MyEclipse---project Facets设置java文件的版本为 1.8,并打勾。如果没有MyEclipse选项,直接在搜索框内输入project Facets
之后就没问题了
以上是关于Eclipse 报错The method xxx of type must override a superclass methodDescription Resource Path Locati的主要内容,如果未能解决你的问题,请参考以下文章
dao 接口定义了一个方法,报错 The method xxx is undefined for the type xxx;
js请求路径控制台报错 Failed to launch ‘xxx‘ because the scheme does not have a registered handler.
vue报错:Unknown custom element: xxx - did you register the component correctly? For recursive compon
eclipse 导入类 提示The import XXX cannot be resolved
SpringBoot写配置文件报错“The elements [xxx,xxx] were left unbound.“