Build path specifies execution environment J2SE-1.5. There are no JREs installed in the workspace that are strictly compatible with this environment.
手工在 java build path 中加载 jre system library。是可以临时的解决
但一旦执行 maven - update project configuration后,配置将恢复,警告又会出现,so
更改pom文件才是王道
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
本文探讨了在使用Maven项目时遇到的Java Build Path与指定环境不兼容的问题,并提供了通过修改pom文件来解决问题的方法。通过在pom文件中配置maven-compiler-plugin,可以指定源代码和目标代码的版本为J2SE 1.6,从而避免了配置冲突,实现了临时和永久的解决方案。
1423

被折叠的 条评论
为什么被折叠?



