java mvn compile - [错误] 此环境中未提供编译器。也许您在 JRE 而不是 JDK 上运行?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/42437232/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
mvn compile - [ERROR] No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?
提问by Snowcrash
I am running mvn compile
from the command line and am getting this:
我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?
I've seen this answer but it's for Eclipse.
我看过这个答案,但它是针对 Eclipse 的。
Any suggestions
有什么建议
回答by kleopi
Set JDK instead of JRE as environment (download it if necessary)
将 JDK 而不是 JRE 设置为环境(如有必要,请下载)
JDK=JRE+Codingstuff (including a compiler)
JDK=JRE+Codingstuff(包括一个编译器)