一、先将maven默认的jdk环境配置为7 在setting.xml文件夹下<profiles></profiles>标签下添加如下代码
<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>
二、将myeclispe编译环境变为jdk1.7
Windows->perferences->搜java->compiler选择1.7
三、将myeclispe jdk变为1.7
Windows->perferences->搜java->installed JREs
Remove原来的jdk,添加新的jdk1.7,点击对勾并确定。