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的):