我认为问题是找不到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)
的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
答案 0 :(得分:3)
尝试javac -version ...
因为'也许你是在JRE而不是JDK上运行'......看起来没有编译器。
/ Library / Internet Plug-Ins / JavaAppletPlugin.plugin / Contents / Home是运行java的地方...并且不链接到JDK而是链接到互联网插件
也许安装JDK或更改JAVA_HOME
答案 1 :(得分:2)
问题非常简单。您的Java版本查询报告JRE。由于maven错误声明它需要JDK。安装JDK并相应地调整环境变量。