maven的conf\setting.xml文件中找到jdk注释的地方,打开修改即可,如下
- <profile>
- <id>jdk-1.8</id>
- <activation>
- <jdk>1.8</jdk>
- </activation>
- <!--<repositories>
- <repository>
- <id>jdk17</id>
- <name>Repository for JDK 1.8 builds</name>
- <url>http://www.myhost.com/maven/jdk18</url>
- <layout>default</layout>
- <snapshotPolicy>always</snapshotPolicy>
- </repository>
- </repositories>-->
- <properties>
- <maven.compiler.source>1.8</maven.compiler.source>
- <maven.compiler.target>1.8</maven.compiler.target>
- <maven.compiler.compilerVersion>1.8</maven.compiler.compilerVersion>
- </properties>
- </profile>
这样默认版本都是jdk1.8了。