只需要在maven项目的pom.xml中将编译器的版本指定为1.8即可
代码如下:
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.0</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
</plugins>
</build>
这样每次更新依赖 j2SE的依赖库都会变成1.8版本
如下如所示:
这样的话以后更新就不会,变为J2se1.5了