刚才把之前的一个maven工程导入eclipse后,发现pom.xml打红叉,其问题如下所示:
解决方法是把【Windows】-【Preferences】-【Java】-【Install JREs】中的JRE给remove掉即可,刚才试着remove掉JRE,问题依然存在,如今为何又不行了,这得回公司才知晓。
在pom.xml中添加对tools.jar的依赖,问题解决:
<dependency>
<groupId>com.sun</groupId>
<artifactId>tools</artifactId>
<version>1.6.0</version>
<scope>system</scope>
<systemPath>D:/Java/jdk1.6.0_27/lib/tools.jar</systemPath>
</dependency>