idea @Override is not allowed when implementing interface method

来源:互联网 发布:尚学堂oa源码 编辑:程序博客网 时间:2024/06/17 06:41

近期研究idea,在编码过程发现报错:@Override is not allowed when implementing interface method 。找到一个老外的回答,感觉挺有用的,记录下来,以供参考:

1、在project/module上,右键选择菜单“Open Module Settings” ;

2、选择Modules,修改“Language Level” 为 “8-Lambdas,......”;

3、选择Project, 修改“Project language level” 为 “SDK default”。

4、保存,重启。


我的本地是 maven 管理的项目, 所以在  pom.xml 中添加 

[html] view plain copy
  1. <plugin>  
  2.                 <groupId>org.apache.maven.plugins</groupId>  
  3.                 <artifactId>maven-compiler-plugin</artifactId>  
  4.                 <version>3.2</version>  
  5.                 <configuration>  
  6.                     <source>1.6</source>  
  7.                     <target>1.6</target>  
  8.                 </configuration>  
  9.             </plugin>  
就搞定了! 
阅读全文
0 0