Elasticsearch-2.3.5 maven build error with enforce-plugin (java home)

I have been trying to build ES-2.3.5 with in eclipse.When i run as clean package build fails with the following message:
WARNING] Rule 0: org.apache.maven.plugins.enforcer.RequireEnvironmentVariable failed with message:
Maven Version: 3.3.9
[INFO] JDK Version: 1.8.0_111 normalized as: 1.8.0-111
[INFO] OS Info: Arch: amd64 Family: unix Name: linux Version: 3.8.0
*****"JAVA_HOME must be set and point to the jdk to run the tests"
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] Build Tools and Resources .......................... SUCCESS [ 2.171 s]
[INFO] Rest API Specification ............................. SUCCESS [ 0.703 s]
[INFO] Elasticsearch: Parent POM .......................... SUCCESS [ 16.517 s]
[INFO] Elasticsearch: Core ................................ FAILURE [ 1.474 s]
[INFO] Distribution: Parent POM ........................... SKIPPED
[INFO] Integration Test Package: ZIP ...................... SKIPPED
[INFO] Module: Parent POM ................................. SKIPPED
[INFO] Module: Language: Expression ....................... SKIPPED
[INFO] Module: Language: Groovy ........................... SKIPPED
[INFO] Module: Reindex .................................... SKIPPED
[INFO] Distribution: TAR .................................. SKIPPED
[INFO] Distribution: ZIP .................................. SKIPPED
[INFO] Distribution: Deb .................................. SKIPPED
[INFO] Plugin: Parent POM ................................. SKIPPED
[INFO] Plugin: Analysis: Japanese (kuromoji) .............. SKIPPED
[INFO] Plugin: Analysis: Smart Chinese (smartcn) .......... SKIPPED
[INFO] Plugin: Analysis: Polish (stempel) ................. SKIPPED
[INFO] Plugin: Analysis: Phonetic ......................... SKIPPED
[INFO] Plugin: Analysis: ICU .............................. SKIPPED
[INFO] Plugin: Cloud: Google Compute Engine ............... SKIPPED
[INFO] Plugin: Cloud: Azure ............................... SKIPPED
[INFO] Plugin: Cloud: AWS ................................. SKIPPED
[INFO] Plugin: Delete By Query ............................ SKIPPED
[INFO] Plugin: Discovery: Multicast ....................... SKIPPED
[INFO] Plugin: Language: JavaScript ....................... SKIPPED
[INFO] Plugin: Language: Python ........................... SKIPPED
[INFO] Plugin: Mapper: Attachments ........................ SKIPPED
[INFO] Plugin: Mapper: Murmur3 ............................ SKIPPED
[INFO] Plugin: Mapper: Size ............................... SKIPPED
[INFO] Plugin: JVM example ................................ SKIPPED
[INFO] Plugin: Example site ............................... SKIPPED
[INFO] QA: Parent POM ..................................... SKIPPED
[INFO] QA: Smoke Test Plugins ............................. SKIPPED
[INFO] QA: Smoke Test Multi-Node IT ....................... SKIPPED
[INFO] QA: Smoke Test Client .............................. SKIPPED
[INFO] QA: Smoke Test Command Line Params ................. SKIPPED
[INFO] QA: Smoke Test Reindex with Groovy ................. SKIPPED
[INFO] QA: Backwards Compatibility ........................ SKIPPED
[INFO] QA: BWC: Shared .................................... SKIPPED
[INFO] QA: BWC: Two Versions Parent ....................... SKIPPED
[INFO] QA: BWC: Current ................................... SKIPPED
[INFO] QA: BWC: 2.0 ....................................... SKIPPED
[INFO] QA: BWC: 2.1 ....................................... SKIPPED
[INFO] QA: BWC: 2.2 ....................................... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 23.136 s
[INFO] Finished at: 2016-11-25T16:07:38+05:30
[INFO] Final Memory: 52M/366M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-enforcer-plugin:1.4.1:enforce (enforce-java-home-is-set) on project elasticsearch: Some Enforcer rules have failed. Look above for specific messages explaining why the rule failed. -> [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/MojoExecutionException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn -rf :elasticsearch

As of my understanding it says JAVA_HOME is not pointing to jdk
im on ubuntu
I see ->echo $JAVA_HOME
/usr/lib/jvm/java-8-openjdk-amd64
i see -> which java
/usr/lib/jvm/java-8-openjdk-amd64/bin/java

where am i going wrong .please do help

Hi,

In order to build a java project you need "javac" from JDK and not a JRE , do you have this:

ls -la /usr/lib/jvm/java-8-openjdk-amd64/bin/javac

Question: Why to you need to build the ES jar ?

yes i have javac
$which javac
/usr/lib/jvm/java-8-openjdk-amd64/bin/javac

For debug purpose i want to build it ..also to try some changes..

Its still showing the same error..

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.