zoukankan      html  css  js  c++  java
  • m2e (maven eclipse) 在运行一些命令时出现了无法compile(Unable to locate the Javac Compiler in:)

    出现的bug提示

    Unable to locate the Javac Compiler in:
    C:\Program Files\Java\jre1.6.0_07\..\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.

    从上面的Please ensure you are using JDK 1.4 or above and
    not a JRE (the com.sun.tools.javac.Main class is required)

    可以看出m2e要求用于编译应该要用jdk且jdk是1.4及以上的版本才行

    我在命令行下echo %JAVA_HOME%

    检查了一下我的"JAVA_HOME"是C:\Program Files\Java\jdk1.6.0_20

    那是哪里出错了呢,,这时我意识到我用的是m2e,那么我的运行时环境应该就是根据

    eclipse(eclipse也有默认也有自己的运行时环境)指定的才是,,那么我只要把修改eclipse指定的运行时环境路径不就可以了,

    于是

    1、在eclipse里面修改 "window-->preferences->java->installed jres" 如图:

    edit the selected jre or add a new jre and select it  

    the location should be "C:\Program Files\Java\jdk1.6.0_20\jre"

    please don't close the "Edit JRE" dialog ,continue the second step.

    2、remove the default jre system libraries and add all the jar in  the lib folder, lib subdirectory in  %JAVA_HOME%/jdk**/jre/

    illustration:

    _^^_.......I wish this bug report message will help u....and please comment this ...

     

     

     

     

    在用maven的这些日子以来,发现还有一种可能出现这种错误,就是你已经install了你的项目,,这时出现这种bug时,你需到仓库去把这些已存在的版本删除即可

  • 相关阅读:
    HIFU控制器的显示板
    风扇控制板
    直流源控制板
    HIFU的心脏
    强劲的全桥驱动
    脑电模块
    另一个12导联心电模块
    数据处理,pandas方面遇到的问题
    6.13 django
    python 零基础学习之路-06 常用模块
  • 原文地址:https://www.cnblogs.com/silentjesse/p/2727407.html
Copyright © 2011-2022 走看看