原因
编译使用的jdk版本(12)高于运行环境的jre版本(1.8)(1)
解决办法
指定maven编译版本,用release代替source/target
<properties>
<maven.compiler.release>8</maven.compiler.release>
<!-- <maven.compiler.source>1.8</maven.compiler.source>-->
<!-- <maven.compiler.target>1.8</maven.compiler.target>-->
</properties>
要求maven compiler版本>=3.6
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>