<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
pom.xml文件的<build><plugins>节点内添加以上配置,如有有这个配置直接修改其版本号即可https://www.leftso.com/article/200.html