简体   繁体   English

Yosemite上的Maven安装失败:此环境中未提供编译器

[英]Maven installation failure on Yosemite: No compiler is provided in this environment

I think problem is mvn don't find java or something like that. 我认为问题是mvn找不到Java或类似的东西。

If I run java -version 如果我运行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)

Maven: Maven:

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

try javac -version... 尝试javac -version ...

because 'Perhaps you are running on a JRE rather than a JDK'... Looks like there is no compiler. 因为“也许您正在JRE而不是JDK上运行” ...似乎没有编译器。

/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home is where java is ran from... And does not link to a JDK but to an internet plugin / Library / Internet插件/JavaAppletPlugin.plugin/Contents/Home是运行Java的地方...并且不链接到JDK,而是链接到Internet插件

Maybe install JDK or change JAVA_HOME 也许安装JDK或更改JAVA_HOME

The problem is pretty straightforward. 问题很简单。 Your java version query reports a JRE. 您的Java版本查询报告一个JRE。 As the maven error states it needs the JDK. 正如Maven错误指出的那样,它需要JDK。 Install the JDK and adjust the environment variable accordingly. 安装JDK并相应地调整环境变量。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM