环境:
名称 | 版本 |
springboot | 2.7.11 |
jdk | 1.8 |
maven | 3.6.3 |
在pom.xml中添加如下代码:
<build>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
</plugins>
</build>
例如:
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
</plugins>
</build>
注意:
springboot 3.x版本下需要 jdk 17
springboot 2.x版本下需要 jdk 8
标签:springboot,plugin,boot,1.8,maven,解决,打包,compiler From: https://blog.51cto.com/u_16087128/6221524