from:http://blog.csdn.net/longxia1987/article/details/7513103java
在使用eclipse 运行 maven install的时候,出现这个错误:eclipse
[ERROR] Unable to locate the Javac Compiler in:
D:\Program Files\Java\jre6\..\lib\tools.jar
Please ensure you are using JDK 1.4 or above and
not a JRE (the com.sun.tools.javac.Main class is required).
In most cases you can change the location of your Java
installation by setting the JAVA_HOME environment variable.maven
解决方法:ide
一、在eclipse.ini文件中设置ui
-vm
C:\Program Files\Java\jdk1.6.0_21\jre\bin\javaw.exespa
注意.net
要在eclipse.ini文件中-startup以前设置这一行blog
二、ip
window-->preferences-->java-->Installed JREs:将路径设置成jre的路径get
重启eclipse
补充:
针对我本身的情形,修改以下,使用JDK下面的jre(其实,点完OK就生效了,不须要重启eclipse的):