@Override is not allowed when implementing interface method

来源:互联网 发布:软件测试平均工资 编辑:程序博客网 时间:2024/06/06 06:36

IDEA导入项目后出现@Override错误,虽然不影响编译,但是看起来不和谐。


对于这个问题,网上有两种解决方案:

1、File-->Project Structure...-->Module-->选中模型-->Language Level,选择6(网上这种方案较多)



2、pom文件中配置maven-compiler-plugin(个人认为这种方案更正确,可以避免每个人都要按照解决方案一设置一次)

<plugin>  <groupId>org.apache.maven.plugins</groupId>  <artifactId>maven-compiler-plugin</artifactId>  <version>3.2</version>  <configuration>  <source>1.6</source>  <target>1.6</target>  </configuration>  </plugin>  


0 0
原创粉丝点击