【问题标题】:mvn compile - [ERROR] No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK? [duplicate]mvn compile - [错误] 此环境中未提供编译器。也许您在 JRE 而不是 JDK 上运行? [复制]
【发布时间】:2017-07-15 04:51:31
【问题描述】:

我正在从命令行运行 mvn compile 并得到以下信息:

[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?
[INFO] 1 error
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 04:12 min
[INFO] Finished at: 2017-02-24T10:19:32+00:00
[INFO] Final Memory: 24M/247M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project spring-boot-sam
ple-atmosphere: Compilation failure
[ERROR] No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?

我已经看到了这个答案,但它是针对 Eclipse 的。

任何建议

【问题讨论】:

    标签: java maven


    【解决方案1】:

    设置JDK而不是JRE作为环境(必要时下载)

    JDK=JRE+Codingstuff(包括编译器)

    【讨论】:

    • 这就是问题所在。
    【解决方案2】:

    您需要更新环境变量(在 ENV 变量中提供 JDK 路径) 这里link如何设置

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-10-23
      • 2018-02-25
      • 2013-11-08
      • 2016-04-29
      • 2018-06-12
      • 2018-11-12
      • 2021-04-30
      • 1970-01-01
      相关资源
      最近更新 更多