Modify the JDK version in Maven and jdk in maven.
1. The Global modification method is valid for life after one modification.
Modify the Maven configuration file MVN_HOME/conf/settings. xml.
<profiles> <profile> <id>jdk-1.6</id> <activation> <activeByDefault>true</activeByDefault> <jdk>1.6</jdk> </activation> <properties> <maven.compiler.source>1.6</maven.compiler.source> <maven.compiler.target>1.6</maven.compiler.target> <maven.compiler.compilerVersion>1.6</maven.compiler.compilerVersion> </properties> </profile></profiles>
2. Local modification is only valid for this project and does not affect other projects
Add in pom. xml of the project
<plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <version>2.0.2</version> <configuration> <source>1.7</source> <target>1.7</target> </configuration> </plugin>
Copyright Disclaimer: This article is an original article by the blogger and cannot be reproduced without the permission of the blogger.