经查看,发现 Target bytecode version 为 1.5 版本,Language level 版本也为 5
解决办法:
方法一(推荐)
<!--pom.xml-->
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.8</source>
<target>1.8</target>
<encoding>utf-8</encoding>
</configuration>
</plugin>
</plugins>
</build>
方法二
将 Target bytecode version 改为更高版本
将 Language level 也改为更高版本