【问题标题】:Maven installation failure on Yosemite: No compiler is provided in this environmentYosemite上Maven安装失败:此环境未提供编译器
【发布时间】:2015-09-21 05:13:01
【问题描述】:

我认为问题是 mvn 找不到 java 或类似的东西。

如果我运行 java -version

java version "1.8.0_45"
Java(TM) SE Runtime Environment (build 1.8.0_45-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.45-b02, mixed mode)

马文:

Apache Maven 3.3.3 (7994120775791599e205a5524ec3e0dfe41d4a06; 2015-04-22T13:57:37+02:00)
Maven home: /Users/rubenortiz/apache-maven-3.3.3
Java version: 1.8.0_45, vendor: Oracle Corporation
Java home: /Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home
Default locale: es_ES, platform encoding: UTF-8
OS name: "mac os x", version: "10.10.3", arch: "x86_64", family: "mac"


[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 5.003 s
[INFO] Finished at: 2015-07-03T13:09:44+02:00
[INFO] Final Memory: 23M/302M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.3:compile (default-compile) on project core: Compilation failure
[ERROR] No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn <goals> -rf :core

【问题讨论】:

    标签: java maven osx-yosemite


    【解决方案1】:

    试试 javac -version...

    因为'也许您在 JRE 而不是 JDK 上运行'...看起来没有编译器。

    /Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home 是运行 java 的地方...并且不链接到 JDK 而是链接到 Internet 插件

    可能安装 JDK 或更改 JAVA_HOME

    【讨论】:

      【解决方案2】:

      问题很简单。您的 java 版本查询报告了 JRE。正如 Maven 错误所述,它需要 JDK。安装 JDK 并相应地调整环境变量。

      【讨论】:

        猜你喜欢
        • 2021-11-26
        • 2018-08-25
        • 2019-08-16
        • 2014-02-01
        • 2014-05-08
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多