- 我们在用eclipse创建maven项目的时候,jre system library会自动默认1.5版本,可以通过 java
compiler 去解决,但不是每个项目都要弄太麻烦了。 - 我找的解决方法:
- 找到maven的settings文件,在profiles标签中加入如下内容,便一劳永逸!!
<profile>
<id>jdk-1.7</id>
<activation>
<activeByDefault>true</activeByDefault>
<jdk>1.7</jdk>
</activation>
<properties>
<maven.compiler.source>1.7</maven.compiler.source>
<maven.compiler.target>1.7</maven.compiler.target>
<maven.compiler.compilerVersion>1.7</maven.compiler.compilerVersion>
</properties>
</profile>