Eclipse 报错The method xxx of type must override a superclass method、Description Resource Path Location Type Java compiler level does not match the version of the installed Java project facet

问题:

Eclipse 报错The method xxx of type must override a superclass method、Description  Resource Path Location Type Java compiler level does not match the version of the installed Java project facet

如上图, 没改钱@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)

Eclipse 报错The method xxx of type must override a superclass method、Description  Resource Path Location Type Java compiler level does not match the version of the installed Java project facet

因为我的jdk是1.8的所以选择1.8

Eclipse 报错The method xxx of type must override a superclass method、Description  Resource Path Location Type Java compiler level does not match the version of the installed Java project facet

2、右键项目--properties---java Compiler 把项目编译版本也设置成 1.8

Eclipse 报错The method xxx of type must override a superclass method、Description  Resource Path Location Type Java compiler level does not match the version of the installed Java project facet

Eclipse 报错The method xxx of type must override a superclass method、Description  Resource Path Location Type Java compiler level does not match the version of the installed Java project facet

3、右键项目--properties---MyEclipse---project Facets设置java文件的版本为 1.8,并打勾。如果没有MyEclipse选项,直接在搜索框内输入project Facets

Eclipse 报错The method xxx of type must override a superclass method、Description  Resource Path Location Type Java compiler level does not match the version of the installed Java project facet

之后就没问题了

查看原文

上一篇:【转】Description Resource Path Location Type Java compiler level&n


下一篇:导入项目报错:Type Java compiler level does not match the version