目录


- <properties>
- <maven.compiler.source>8maven.compiler.source>
- <maven.compiler.target>8maven.compiler.target>
- properties>
pom.xml中的maven.compiler.source和maven.compiler.是用来编译源码和打包的,通常它们的版本等于系统JDK的大版本,如11,9,8...;
如果不能控制客户机的jdk,而想让包的适用性更广的话,可以手动降低版本号,比如如从11降到8;
如此做了后,在别的机器上运行自己的jar,就不会爆jdk版本低的错误。
举例来说,我之前使用11打了个jar包,放到jdk=9的虚拟机上没法用,于是手动降低到8,因为代码中也确实没用到8后继版本的特性,于是再次打包后,虚拟机上再运行就可以了。
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
4.0.0
org.example
JsonPretty
1.00
8
8
org.springframework.boot
spring-boot-starter
2.6.4
org.springframework
spring-webmvc
5.3.16
commons-lang
commons-lang
2.6
org.springframework.boot
spring-boot-maven-plugin
repackage






将版本都改成对应的就可以运行了,一般jdk出现1.5错误,无法install,只需要在模块的pom.xml中加入
然后修改各个版本对应即可
即可install