在使用eclipse 運行 maven install的時候,出現錯誤:

一、問題描敘

我使用的Eclipse的是 :java

Eclipse Java EE IDE for Web Developers.
Version: Kepler Release
Build id: 20130614-0229apache

Maven:apache-maven-2.2.1eclipse

異常情景:
maven

在使用eclipse 運行 maven install的時候,出現這個錯誤:
ui

ERROR: Unable to locate the Javac Compiler in:,  C:\Program Files (x86)\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.spa

二、嘗試解決辦法:

2.1:打開 :Window -> Preferences -> Java -> installed JREs ->

選擇你正在使用的JRE(應該是一個在jdk。例:C:\Program Files\Java\jdk1.6.0_43 )
ip

2.2  、接着,點擊「Edit」,進入下一個畫面:選擇添加 C:\Program Files\Java\jdk1.6.0_43\lib\tools.jar ,點擊 Finish。

2.三、接下來,打開 Window -> Preferences -> Java -> installed JREs -> Execution Enviroments ->

進入畫面:選擇JavaSE-1.6和相匹配的 jre 。點擊OK。
it


,到此,從新運行 maven install。成功!
io

相關文章
相關標籤/搜索