Eclipse maven build compiler failure - no stacktrace

3.6k views Asked by At

I'm trying to build Apache Gora, which you can find here and I've downloaded it as a modular apache maven project. When I try to build gora with an execute maven from eclipse with the install goal I get the following error:

[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

It also tells me the following:

[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 //////

But, if I re-run the install without a workspace clean in the next run it builds correctly the Compiler module. If I re-run again the following module gets a success and so on. I can't make heads or tails of what's happening here.

1

There are 1 answers

0
wittakarn On BEST ANSWER

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

If you're running Maven from Eclipse (e.g. Run As : Maven Install), make sure your environment is configured with correct JRE (you'll need JDK, not JRE). Go to Window -> Preferences -> Java -> Installed JRE. Select JDK if it's there or add JDK if it's not.