# ES gradle check error

**URL:** <https://discuss.elastic.co/t/es-gradle-check-error/141051>\
**Category:** Elasticsearch\
**Created:** [July 22, 2018, 9:33pm UTC](https://discuss.elastic.co/t/es-gradle-check-error/141051 "2018-07-22T21:33:39Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![aaronoah](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/aaronoah/32/27950_2.png) [@aaronoah](https://discuss.elastic.co/u/aaronoah)\
**Post date:** [July 22, 2018, 9:33pm UTC](https://discuss.elastic.co/t/es-gradle-check-error/141051/1 "2018-07-22T21:33:39Z")

</div>

Hi community members,

I'm trying to contribute to ES but when I run `./gradlew check` to validate tests before writing any codes, I have the following error:

To honour the JVM settings for this build a new JVM will be forked. Please consider using the daemon: [The Gradle Daemon - Gradle User Manual](https://docs.gradle.org/4.9/userguide/gradle_daemon.html).  
Daemon will be stopped at the end of the build stopping after processing

> Configure project :benchmarks  
> =======================================  
> Elasticsearch Build Hamster says Hello!  
> =======================================  
> Gradle Version : 4.9  
> OS Info : Mac OS X 10.13.6 (x86\_64)  
> JDK Version : Oracle Corporation 10.0.1 [Java HotSpot(TM) 64-Bit Server VM 10.0.1+10]  
> JAVA\_HOME : /Users/AaronZhao/.sdkman/candidates/java/10.0.1-oracle  
> Random Testing Seed : 51938ABC0ECA7336

FAILURE: Build failed with an exception.

- What went wrong:  
JAVA7\_HOME required to run tasks:  
:modules:reindex:oldEs2Fixture  
:modules:reindex:oldEs1Fixture  
:modules:reindex:oldEs090Fixture  
JAVA8\_HOME required to run tasks:  
:distribution:bwc:next-bugfix-snapshot:buildBwcVersion  
:distribution:bwc:next-minor-snapshot:buildBwcVersion  
JAVA10\_HOME required to run tasks:  
:distribution:bwc:next-bugfix-snapshot:buildBwcVersion  
:distribution:bwc:next-minor-snapshot:buildBwcVersion

- Try:  
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

- Get more help at [https://help.gradle.org](https://help.gradle.org)

BUILD FAILED in 54s

I'm using Intellij IDEA 2018.1

---

<div class="post-metadata">

**Author:** ![TimV](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/timv/32/13162_2.png) [@TimV](https://discuss.elastic.co/u/TimV)\
**Post date:** [July 23, 2018, 1:51am UTC](https://discuss.elastic.co/t/es-gradle-check-error/141051/2 "2018-07-23T01:51:06Z")

</div>

Some of the tests require running on specific versions of Java.

For example, in the first error, we want to test reindexing from Elasticsearch v0.9, v1 and v2, but those versions of ES only ran on Java 7, so it is not possible for those tests to complete unless you have a Java 7 VM.

The build requires that you have environment variables named

- `JAVA7_HOME`
- `JAVA8_HOME`
- `JAVA10_HOME`

that point to their respective Java installations in order to run those tests.

Our development docs _ought_ to explain this, but don't.  
Perhaps your first contribution could be a PR to add that information to the CONTRIBUTING doc.

---

<div class="post-metadata">

**Author:** ![aaronoah](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/aaronoah/32/27950_2.png) [@aaronoah](https://discuss.elastic.co/u/aaronoah)\
**Post date:** [July 24, 2018, 3:15am UTC](https://discuss.elastic.co/t/es-gradle-check-error/141051/3 "2018-07-24T03:15:08Z")

</div>

Unfortunately, I set the env variables but they don't seem to work. ☹

---

<div class="post-metadata">

**Author:** ![TimV](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/timv/32/13162_2.png) [@TimV](https://discuss.elastic.co/u/TimV)\
**Post date:** [July 24, 2018, 5:26am UTC](https://discuss.elastic.co/t/es-gradle-check-error/141051/4 "2018-07-24T05:26:24Z")

</div>

I suspect that you haven't set them up correctly, as this is same build process that all the Elasticsearch development team uses.

Can you show more details about how you set these variables? Did you `export` them for child processes?

---

<div class="post-metadata">

**Author:** ![aaronoah](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/aaronoah/32/27950_2.png) [@aaronoah](https://discuss.elastic.co/u/aaronoah)\
**Post date:** [July 24, 2018, 1:28pm UTC](https://discuss.elastic.co/t/es-gradle-check-error/141051/5 "2018-07-24T13:28:04Z")

</div>

I use sdkman to manage the versions of Java

the env JAVA7\_HOME points to /Users/AaronZhao/.sdkman/candidates/java/7.0.181-zulu  
the env JAVA8\_HOME points to /Users/AaronZhao/.sdkman/candidates/java/8.0.171-oracle  
the env JAVA10\_HOME points to /Users/AaronZhao/.sdkman/candidates/java/10.0.1-oracle

I exported them but a different error is thrown when running `gradlew check`:

> Configure project :benchmarks  
> =======================================  
> Elasticsearch Build Hamster says Hello!  
> =======================================  
> Gradle Version : 4.9  
> OS Info : Mac OS X 10.13.6 (x86\_64)  
> JDK Version : Oracle Corporation 10.0.1 [Java HotSpot(TM) 64-Bit Server VM 10.0.1+10]  
> JAVA\_HOME : /Users/AaronZhao/.sdkman/candidates/java/10.0.1-oracle  
> Random Testing Seed : 26EF5F990E73DB57  
> STDOUT:  
> STDERR:  
> script engine for language js can not be found  
> Project evaluation failed including an error in afterEvaluate {}. Run with --stacktrace for details of the afterEvaluate {} error.

FAILURE: Build failed with an exception.

- Where:  
Build file '/Users/AaronZhao/Git/elasticsearch/benchmarks/build.gradle' line: 20

- What went wrong:  
A problem occurred evaluating project ':benchmarks'.

> Failed to apply plugin [id 'elasticsearch.build']  
> Could not determine java version from ''.

---

<div class="post-metadata">

**Author:** ![nik9000](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nik9000/32/44947_2.png) [@nik9000](https://discuss.elastic.co/u/nik9000)\
**Post date:** [July 26, 2018, 3:52pm UTC](https://discuss.elastic.co/t/es-gradle-check-error/141051/6 "2018-07-26T15:52:30Z")

</div>

I think I remember something about this. Could you try setting your JAVA\_HOME to JAVA8\_HOME and running the build? I remember reading somewhere about the js scripts that we use early in the build being trouble.

---

<div class="post-metadata">

**Author:** ![aaronoah](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/aaronoah/32/27950_2.png) [@aaronoah](https://discuss.elastic.co/u/aaronoah)\
**Post date:** [July 26, 2018, 8:45pm UTC](https://discuss.elastic.co/t/es-gradle-check-error/141051/7 "2018-07-26T20:45:35Z")

</div>

No, it doesn't work either. Now it's complaining about the JDK version

> Configure project :benchmarks  
> =======================================  
> Elasticsearch Build Hamster says Hello!  
> =======================================  
> Gradle Version : 4.9  
> OS Info : Mac OS X 10.13.6 (x86\_64)  
> JDK Version : Oracle Corporation 1.8.0\_171 [Java HotSpot(TM) 64-Bit Server VM 25.171-b11]  
> JAVA\_HOME : /Users/AaronZhao/.sdkman/candidates/java/8.0.171-oracle  
> Random Testing Seed : 8B2518F798FD765C  
> Project evaluation failed including an error in afterEvaluate {}. Run with --stacktrace for details of the afterEvaluate {} error.

FAILURE: Build failed with an exception.

- Where:  
Build file '/Users/AaronZhao/Git/elasticsearch/benchmarks/build.gradle' line: 20

- What went wrong:  
A problem occurred evaluating project ':benchmarks'.

> Failed to apply plugin [id 'elasticsearch.build']  
> the environment variable JAVA\_HOME must be set to a JDK installation directory for Java 1.10 but is [/Users/AaronZhao/.sdkman/candidates/java/8.0.171-oracle] corresponding to [1.8]

---

<div class="post-metadata">

**Author:** ![rjernst](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rjernst/32/6363_2.png) [@rjernst](https://discuss.elastic.co/u/rjernst)\
**Post date:** [July 30, 2018, 9:44pm UTC](https://discuss.elastic.co/t/es-gradle-check-error/141051/8 "2018-07-30T21:44:22Z")

</div>

The build runs `$JAVA_HOME/bin/jrunscript` to find information about the the configured java versions the build will use. In your case, it seems it cannot find the javascript implementation:

`script engine for language js can not be found`

I'm not sure how this could happen. Have you tried a java installation not using sdkman to see if it works?

---

<div class="post-metadata">

**Author:** ![aaronoah](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/aaronoah/32/27950_2.png) [@aaronoah](https://discuss.elastic.co/u/aaronoah)\
**Post date:** [July 31, 2018, 12:00am UTC](https://discuss.elastic.co/t/es-gradle-check-error/141051/9 "2018-07-31T00:00:52Z")

</div>

When I use official Oracle jdks, the shell does not complain about errors, Thank you!  
I'm not sure if this is a bug of sdkman, but I think I need to warn the developers in the README for a doc PR.

---

<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:** [August 28, 2018, 12:01am UTC](https://discuss.elastic.co/t/es-gradle-check-error/141051/10 "2018-08-28T00:01:04Z")

</div>

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