1、解决办法:1、在pom文件中配置maven-compiler-plugin插件。1.1、<jdk.version>1.8</jdk.version> <java.home>D:\Java\jdk1.8.0_45_64</java.home>1.2、<plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <version>3.5.1</version> <configuration> <source>${jdk.version}</source> <target>${jdk.version}</target> <encoding>${project.build.sourceEncoding}</encoding> <compilerArguments> <verbose /> <bootclasspath>${java.home}\jre\lib\rt.jar;${java.home}\jre\lib\jce.jar</bootclasspath> </compilerArguments> </configuration> </plugin>
2、再编译就成功了