Build path specifies execution environment J2SE-1.5. There are no JREs installed in the workspace that are strictly compatible with this environment.
新建maven2工程时,会自动将jre library指向为j2se-1.5,而不是我安装的jdk1.6,
在java build path 中奖j2se-1.5移除掉又选择jdk1.6后,右键项目maven -》update
project..又把我的jdk改成了1.5.
后来更改maven 的pom文件才解决这一问题:
- <build>
- <finalName>MavenProject</finalName>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-compiler-plugin</artifactId>
- <configuration>
- <source>1.6</source>
- <target>1.6</target>
- </configuration>
- </plugin>
- </plugins>
- </build>