@Override is not allowed when implementing interface method

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


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

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



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

  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>

想要更多干货、技术猛料的孩子,快点拿起手机扫码关注我,我在这里等你哦~

猜你喜欢

转载自blog.csdn.net/linzhiqiang0316/article/details/80946710
今日推荐