# Elasticsearch build failure

**URL:** https://discuss.elastic.co/t/elasticsearch-build-failure/276965
**Category:** Elasticsearch
**Created:** [June 24, 2021, 5:08pm UTC](https://discuss.elastic.co/t/elasticsearch-build-failure/276965 "2021-06-24T17:08:58Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![TheHunter1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/thehunter1/32/80190_2.png) [@TheHunter1](https://discuss.elastic.co/u/TheHunter1)
#### Post date: [June 24, 2021, 5:08pm UTC](https://discuss.elastic.co/t/elasticsearch-build-failure/276965/1 "2021-06-24T17:08:58Z")

</div>

Hello,

I was running ELK from source, and today I run "git pull" and tried to build again, but when I run "./gradlew assemble" I am getting these errors :

```auto
FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring root project 'elasticsearch'.
> Could not resolve all artifacts for configuration ':classpath'.
   > Could not resolve project :build-tools-internal.
     Required by:
         project :
      > No matching variant of project :build-tools-internal was found. The consumer was configured to find a runtime of a library compatible with Java 15, packaged as a jar, and its dependencies declared externally, as well as attribute 'org.gradle.plugin.api-version' with value '7.1' but:
          - Variant 'apiElements' capability org.elasticsearch.gradle:build-tools-internal:8.0.0-SNAPSHOT declares a library, packaged as a jar, and its dependencies declared externally:
              - Incompatible because this component declares an API of a component compatible with Java 16 and the consumer needed a runtime of a component compatible with Java 15
              - Other compatible attribute:
                  - Doesn't say anything about org.gradle.plugin.api-version (required '7.1')
          - Variant 'runtimeElements' capability org.elasticsearch.gradle:build-tools-internal:8.0.0-SNAPSHOT declares a runtime of a library, packaged as a jar, and its dependencies declared externally:
              - Incompatible because this component declares a component compatible with Java 16 and the consumer needed a component compatible with Java 15
              - Other compatible attribute:
                  - Doesn't say anything about org.gradle.plugin.api-version (required '7.1')

* 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

BUILD FAILED in 54s
4 actionable tasks: 4 executed

```

I tried with both Java 15 and Java 16 and still getting the same error

Any help please !  
Best regards

---

<div class="post-metadata">

### Author: ![mayya](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mayya/32/83147_2.png) [@mayya](https://discuss.elastic.co/u/mayya)
#### Post date: [June 24, 2021, 10:14pm UTC](https://discuss.elastic.co/t/elasticsearch-build-failure/276965/2 "2021-06-24T22:14:31Z")

</div>

You should use Java 16 GA version. Are you by chance using Java 16 EA version?

---

<div class="post-metadata">

### Author: ![TheHunter1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/thehunter1/32/80190_2.png) [@TheHunter1](https://discuss.elastic.co/u/TheHunter1)
#### Post date: [June 25, 2021, 9:43am UTC](https://discuss.elastic.co/t/elasticsearch-build-failure/276965/3 "2021-06-25T09:43:28Z")

</div>

Thanks for your answer @mayya ,

Tthe error is cleared now, but I had a new errors when I try to build it :

```auto

2: Task failed with an exception.
-----------
* What went wrong:
Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0

* 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

BUILD FAILED in 5s
19 actionable tasks: 19 up-to-date

```

and when I try `./gradlew clean`

```auto

FAILURE: Build completed with 2 failures.

1: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':distribution:archives:linux-tar:clean'.
> java.io.IOException: Unable to delete directory '/home/ELK-8/elasticsearch/distribution/archives/linux-tar/build'
    Failed to delete some children. This might happen because a process has files open or has its working directory set in the target directory.
    - /home/ELK-8/elasticsearch/distribution/archives/linux-tar/build/install/elasticsearch-8.0.0-SNAPSHOT/plugins/mapper-size/LICENSE.txt
    - /home/ELK-8/elasticsearch/distribution/archives/linux-tar/build/install/elasticsearch-8.0.0-SNAPSHOT/plugins/mapper-size/NOTICE.txt
    - /home/ELK-8/elasticsearch/distribution/archives/linux-tar/build/install/elasticsearch-8.0.0-SNAPSHOT/plugins/mapper-size/plugin-descriptor.properties
    - /home/ELK-8/elasticsearch/distribution/archives/linux-tar/build/install/elasticsearch-8.0.0-SNAPSHOT/plugins/mapper-size/mapper-size-8.0.0-SNAPSHOT.jar
    - /home/ELK-8/elasticsearch/distribution/archives/linux-tar/build/install/elasticsearch-8.0.0-SNAPSHOT/plugins/mapper-size
    - /home/ELK-8/elasticsearch/distribution/archives/linux-tar/build/install/elasticsearch-8.0.0-SNAPSHOT/plugins
    - /home/ELK-8/elasticsearch/distribution/archives/linux-tar/build/install/elasticsearch-8.0.0-SNAPSHOT
    - /home/ELK-8/elasticsearch/distribution/archives/linux-tar/build/install

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

2: Task failed with an exception.
-----------
* What went wrong:
Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0

* 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

```

---

<div class="post-metadata">

### Author: ![mayya](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mayya/32/83147_2.png) [@mayya](https://discuss.elastic.co/u/mayya)
#### Post date: [June 25, 2021, 6:55pm UTC](https://discuss.elastic.co/t/elasticsearch-build-failure/276965/4 "2021-06-25T18:55:57Z")

</div>

Just wanted to let you know that the Gradle version I am using is Gradle 7.1, and the build process works for me.

---

<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 23, 2021, 6:56pm UTC](https://discuss.elastic.co/t/elasticsearch-build-failure/276965/5 "2021-07-23T18:56:00Z")

</div>

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