In IntelliJ idea 14.1, JDK is not configured in java Maven. idea14.1maven
When using Maven in IntelliJ IDEA 14.1 in java projects, IDEA sets the default build version and source code version to jdk5.
In IDEA, the Language level uses the default JDK 5 level.
The target version is JDK5 by default.
When you manually change to another version, such as JDK 8, but when you re-load the Maven project, IDEA sets the default Language level and Target bycode version to JDK 5.
In the project, you will see the following problems:
The source value 1.5 is out of date and will be deleted in all future versions.
The target value 1.5 is out of date and will be deleted in all future versions.
This is because IDEA sets the source code version of the project to jdk1.5 by default and the target code to jdk1.5.
Solution:
Add the following in the pom. xml file of the project:
1 <properties>2 <maven.compiler.source>1.8</maven.compiler.source>3 <maven.compiler.target>1.8</maven.compiler.target>4 </properties>
Or modify the Settings. xml file of Maven to add the following content:
1 <profile> 2 <id>jdk-1.8</id> 3 <activation> 4 <activeByDefault>true</activeByDefault> 5 <jdk>1.8</jdk> 6 </activation> 7 <properties> 8 <maven.compiler.source>1.8</maven.compiler.source> 9 <maven.compiler.target>1.8</maven.compiler.target>10 <maven.compiler.compilerVersion>1.8</maven.compiler.compilerVersion> 11 </properties>12 </profile>
After modification, IDEA will use the jdk version configured in Maven in the source and target jdk versions.
First Article address: Solinx
Http://www.solinx.co/archives/157