Eclipse maven构建编译器失败 - 没有堆栈跟踪

时间:2014-11-26 00:20:28

标签: java eclipse maven gora

我正在尝试构建Apache Gora,您可以找到here并将其作为模块化apache maven项目下载。当我尝试使用带有execute maven目标的日食install构建gora时出现以下错误:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project gora-compiler: Compilation failure -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project gora-compiler: Compilation failure

它还告诉我以下内容:

[INFO] Changes detected - recompiling the module!
[INFO] Compiling 2 source files to C:\Users\pmgbe_000\git\gora\gora-compiler\target\classes
[WARNING] Unable to autodetect 'javac' path, using 'javac' from the environment.
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO] 
[INFO] Apache Gora ....................................... SUCCESS [10:08 min]
[INFO] Apache Gora :: Compiler ........................... FAILURE [ 27.690 s]
[INFO] Apache Gora :: Compiler-CLI ....................... SKIPPED
[INFO] Apache Gora :: Shims Hadoop ....................... SKIPPED
/////// OTHER MODULES ALSO SKIPPED //////

但是,如果我在下次运行中重新运行没有工作区clean的安装,它会正确构建编译器模块。如果我再次重新运行,则以下模块会成功,依此类推。我无法对这里发生的事情做出正面或反面。

1 个答案:

答案 0 :(得分:1)

根据[WARNING] Unable to autodetect 'javac' path, using 'javac' from the environment.

如果您从Eclipse运行Maven(例如Run As:Maven Install),请确保您的环境配置了正确的JRE(您需要JDK,而不是JRE)。转到窗口 - >偏好 - > Java - >已安装JRE。如果它存在则选择JDK,如果不存在则选择JDK。