在maven的pom.xml文件中增加:

  1. <build>
  2.  
  3. <plugins>
  4.     <plugin>
  5.         <groupId>org.apache.maven.plugins</groupId>
  6.         <artifactId>maven-compiler-plugin</artifactId>
  7.         <version>3.1</version>
  8.         <configuration>
  9.             <source>1.6</source>
  10.             <target>1.6</target>
  11.         </configuration>
  12.     </plugin>
  13. </plugins>
  14.  
  15. </build>

然后右键项目maven—update project.

ok。

05-11 20:30