# Java 9 Dependency

**URL:** <https://discuss.elastic.co/t/java-9-dependency/135214>\
**Category:** Elasticsearch\
**Created:** [June 9, 2018, 7:03am UTC](https://discuss.elastic.co/t/java-9-dependency/135214 "2018-06-09T07:03:25Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![albendz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/albendz/32/32078_2.png) [@albendz](https://discuss.elastic.co/u/albendz)\
**Post date:** [June 9, 2018, 7:03am UTC](https://discuss.elastic.co/t/java-9-dependency/135214/1 "2018-06-09T07:03:25Z")

</div>

I am trying to set up my development environment to contribute to Elasticsearch. I have forked the repo, cloned it to my machine, and have run the 'idea' target with gradle. When I run './gradlew clean build' I see this message:

```
FAILURE: Build failed with an exception.
* Where:
Build file 'C:\Users\alici\IdeaProjects\elasticsearch\benchmarks\build.gradle' line: 31

* What went wrong:
A problem occurred evaluating project ':benchmarks'.
> Failed to apply plugin [id 'elasticsearch.build']
> the environment variable JAVA9_HOME must be set to a JDK installation directory for Java 1.9 but is 
[C:\Program Files\Java\jdk-10.0.1] corresponding to [1.10]

* 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

Deprecated Gradle features were used in this build, making it incompatible with Gradle 5.0.
See https://docs.gradle.org/4.7/userguide/command_line_interface.html#sec:command_line_warnings

BUILD FAILED in 33s

```

I have set the JAVA9\_HOME to where Java 10 is installed intentionally to see if I could get around this error but it will still ask for Java 9. My problem is that I'm unable to download Java 9 from Oracle without creating an account with them. Can someone recommend the version of JDK 9 that they are using for this project or a way to use only Java 10 instead of additionally installing Java 9?

Thanks!

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [June 9, 2018, 7:17am UTC](https://discuss.elastic.co/t/java-9-dependency/135214/2 "2018-06-09T07:17:00Z")

</div>

I'm using sdkman to switch between java versions and found that very handy.

---

<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:** [June 12, 2018, 6:30am UTC](https://discuss.elastic.co/t/java-9-dependency/135214/3 "2018-06-12T06:30:19Z")

</div>

You can download an OpenJDK build from here [http://jdk.java.net/archive/](http://jdk.java.net/archive/)  
I believe that should work fine for building Elasticsearch.

Alternatively, my recollection is that the Oracle account is a fairly easy process (and free), if you want their builds.

---

<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:** [July 10, 2018, 6:30am UTC](https://discuss.elastic.co/t/java-9-dependency/135214/4 "2018-07-10T06:30:20Z")

</div>

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