Eclipse: Problem: Unable to locate the Javac Compiler in...

来源:互联网 发布:阿里云的解决方案ppt 编辑:程序博客网 时间:2024/05/14 05:55

Problem:

使用eclipse 运行 maven install的时候,出现如下错误:

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.

Solution:

  1. 打开 :Window -> Preferences -> Java -> installed JREs ->
    选择你正在使用的JRE
    (应该是一个jdk。例如:C:\Program Files\Java\jdk1.6.0_43 )

  2. 点击Edit,进入下一个画面:
    选择添加 C:\Program Files\Java\jdk1.6.0_43\lib\tools.jar ,点击 Finish

  3. 打开 Window -> Preferences -> Java -> installed JREs -> Execution Enviroments ->进入画面:
    选择JavaSE-1.6和相匹配的 jre (jdk1.6.0_43)。点击OK

  4. 重新运行 maven install

0 0
原创粉丝点击