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

**URL:** <https://discuss.elastic.co/t/elasticsearch-2-3-5-maven-build-error-with-enforce-plugin-java-home/67188>\
**Category:** Elasticsearch\
**Created:** [November 25, 2016, 12:20pm UTC](https://discuss.elastic.co/t/elasticsearch-2-3-5-maven-build-error-with-enforce-plugin-java-home/67188 "2016-11-25T12:20:20Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![srikanth\_muddu](https://avatars.discourse-cdn.com/v4/letter/s/9e8a1a/32.png) [@srikanth\_muddu](https://discuss.elastic.co/u/srikanth_muddu)\
**Post date:** [November 25, 2016, 12:20pm UTC](https://discuss.elastic.co/t/elasticsearch-2-3-5-maven-build-error-with-enforce-plugin-java-home/67188/1 "2016-11-25T12:20:21Z")

</div>

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](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

---

<div class="post-metadata">

**Author:** ![xavierfacq](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/xavierfacq/32/8744_2.png) [@xavierfacq](https://discuss.elastic.co/u/xavierfacq)\
**Post date:** [November 25, 2016, 12:40pm UTC](https://discuss.elastic.co/t/elasticsearch-2-3-5-maven-build-error-with-enforce-plugin-java-home/67188/2 "2016-11-25T12:40:00Z")

</div>

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 ?

---

<div class="post-metadata">

**Author:** ![srikanth\_muddu](https://avatars.discourse-cdn.com/v4/letter/s/9e8a1a/32.png) [@srikanth\_muddu](https://discuss.elastic.co/u/srikanth_muddu)\
**Post date:** [November 25, 2016, 1:28pm UTC](https://discuss.elastic.co/t/elasticsearch-2-3-5-maven-build-error-with-enforce-plugin-java-home/67188/3 "2016-11-25T13:28:38Z")

</div>

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..

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [December 23, 2016, 1:29pm UTC](https://discuss.elastic.co/t/elasticsearch-2-3-5-maven-build-error-with-enforce-plugin-java-home/67188/4 "2016-12-23T13:29:06Z")

</div>

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