问题描述
使用eclipse创建Maven工程时,出现如下错误:
Description Resource Path Location Type
Build path specifies execution environment J2SE-1.5. There are no JREs installed in the workspace that are strictly compatible with this environment. SpringBasic Build path JRE System Library Problem
解决方案
原因是,maven build 的java build path路径未设置:
效果图:
终极解决方案
由于maven中update project 之后,可能还是会出现上述错误,可在pom.xml 文件中添加插件:
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
</plugins>
</build>
参考 “Faceted Project Prblem (Java Version Mismatch)” error message