# Java class ElasticsearchClient v. 7.17.8

**URL:** <https://discuss.elastic.co/t/java-class-elasticsearchclient-v-7-17-8/324041>\
**Category:** Elasticsearch\
**Tags:** language-clients\
**Created:** [January 26, 2023, 3:49pm UTC](https://discuss.elastic.co/t/java-class-elasticsearchclient-v-7-17-8/324041 "2023-01-26T15:49:02Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![habdank](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/habdank/32/116454_2.png) [@habdank](https://discuss.elastic.co/u/habdank)\
**Post date:** [January 26, 2023, 3:49pm UTC](https://discuss.elastic.co/t/java-class-elasticsearchclient-v-7-17-8/324041/1 "2023-01-26T15:49:02Z")

</div>

Hi,

Java doc for ElasticsearchClient v. 7.17.8 [ElasticsearchClient (java-client 7.17.8 API)](https://artifacts.elastic.co/javadoc/co/elastic/clients/elasticsearch-java/7.17.8/co/elastic/clients/elasticsearch/ElasticsearchClient.html) states that ElasticsearchClient is java class.

However using

```auto
        <dependency>
            <groupId>org.elasticsearch.client</groupId>
            <artifactId>elasticsearch-rest-client</artifactId>
            <version>7.17.8</version>
        </dependency>

```

In the jar elasticsearch-7.17.8.jar I see, that it is only interface (see below).  
In the jar elasticsearch-rest-client-7.17.8.jar, this class/interface does not exists in any form.

What makes of course problems in using it, due to trivial compiler errors.  
They state that I can not use it as it is documented e.g. on the page: [Migrating from the High Level Rest Client](https://www.elastic.co/guide/en/elasticsearch/client/java-api-client/7.17/migrate-hlrc.html)

Question: what is wrong?

Thanks in advance for help and regards,  
Seweryn.

```auto
package org.elasticsearch.client;

import org.elasticsearch.action.ActionFuture;
import org.elasticsearch.action.ActionListener;
import org.elasticsearch.action.ActionRequest;
import org.elasticsearch.action.ActionResponse;
import org.elasticsearch.action.ActionType;
import org.elasticsearch.threadpool.ThreadPool;

public interface ElasticsearchClient {
    <Request extends ActionRequest, Response extends ActionResponse> ActionFuture<Response> execute(ActionType<Response> var1, Request var2);

    <Request extends ActionRequest, Response extends ActionResponse> void execute(ActionType<Response> var1, Request var2, ActionListener<Response> var3);

    ThreadPool threadPool();
}

```

---

<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:** [January 26, 2023, 4:09pm UTC](https://discuss.elastic.co/t/java-class-elasticsearchclient-v-7-17-8/324041/2 "2023-01-26T16:09:46Z")

</div>

I think you are confusing the 2 clients:

- [High Level Rest Client](https://www.elastic.co/guide/en/elasticsearch/client/java-rest/current/java-rest-high.html) (deprecated)
- The new [Java Client](https://www.elastic.co/guide/en/elasticsearch/client/java-api-client/7.17/index.html)

> [@habdank](#):
>
> Question: what is wrong?

What do you want to do?  
Use a Java client for a new project? Then just use the new client as explained here: [Installation | Elasticsearch Java API Client [7.17] | Elastic](https://www.elastic.co/guide/en/elasticsearch/client/java-api-client/7.17/installation.html)

---

<div class="post-metadata">

**Author:** ![habdank](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/habdank/32/116454_2.png) [@habdank](https://discuss.elastic.co/u/habdank)\
**Post date:** [January 27, 2023, 7:43am UTC](https://discuss.elastic.co/t/java-class-elasticsearchclient-v-7-17-8/324041/3 "2023-01-27T07:43:26Z")

</div>

Hi,

Exactly I need to migrate old code (deprecated) to the new one.  
Thank you very much!  
It seems to solve my problem and indeed I was confused myself by different imports.

Best regards,  
Seweryn.

---

<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:** [February 24, 2023, 7:43am UTC](https://discuss.elastic.co/t/java-class-elasticsearchclient-v-7-17-8/324041/4 "2023-02-24T07:43:58Z")

</div>

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