# Java API client 8.x with Elasticsearch 7.x

**URL:** <https://discuss.elastic.co/t/java-api-client-8-x-with-elasticsearch-7-x/318000>\
**Category:** Elasticsearch\
**Tags:** language-clients\
**Created:** [November 2, 2022, 2:30pm UTC](https://discuss.elastic.co/t/java-api-client-8-x-with-elasticsearch-7-x/318000 "2022-11-02T14:30:54Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![YNikolay](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ynikolay/32/100472_2.png) [@YNikolay](https://discuss.elastic.co/u/YNikolay)\
**Post date:** [November 2, 2022, 2:30pm UTC](https://discuss.elastic.co/t/java-api-client-8-x-with-elasticsearch-7-x/318000/1 "2022-11-02T14:30:54Z")

</div>

Hello,

Can the Java API client 8.x be used with Elasticsearch server 7.x?

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [November 2, 2022, 10:08pm UTC](https://discuss.elastic.co/t/java-api-client-8-x-with-elasticsearch-7-x/318000/2 "2022-11-02T22:08:01Z")

</div>

Welcome to our community! 😃

That depends on your specific minor versions. Please see [Compatibility | Java REST Client [7.17] | Elastic](https://www.elastic.co/guide/en/elasticsearch/client/java-rest/current/java-rest-high-compatibility.html) for more details.

---

<div class="post-metadata">

**Author:** ![linkerc](https://avatars.discourse-cdn.com/v4/letter/l/13edae/32.png) [@linkerc](https://discuss.elastic.co/u/linkerc)\
**Post date:** [November 2, 2022, 10:45pm UTC](https://discuss.elastic.co/t/java-api-client-8-x-with-elasticsearch-7-x/318000/3 "2022-11-02T22:45:26Z")

</div>

Follow up with a similar question.  
I'm running 7.15 today (both ES & REST client). Is there a document suggesting how to upgrade to say ES 8.5?  
We don't do instance upgrade. We use double write.  
We will have both 7.15 & 8.5 clusters running during the transition where the applications will double write to both clusters.  
Once the new cluster (8.5) is loaded with enough data, we then switch the reader from old 7.15 to new 8.5 cluster. Then stop the double write from applications and thenshutdown the old 7.15 cluster.  
Our applications consist of both java and python.

With such operation, what is the proper way to migrate our code from REST to API?  
Any pointers will be highly appreciated.  
Thanks.

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [November 2, 2022, 10:47pm UTC](https://discuss.elastic.co/t/java-api-client-8-x-with-elasticsearch-7-x/318000/4 "2022-11-02T22:47:49Z")

</div>

Please create a new topic, as your question is a lot deeper than just version number compatibility.

---

<div class="post-metadata">

**Author:** ![swallez](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/swallez/32/11972_2.png) [@swallez](https://discuss.elastic.co/u/swallez)\
**Post date:** [November 3, 2022, 9:00am UTC](https://discuss.elastic.co/t/java-api-client-8-x-with-elasticsearch-7-x/318000/5 "2022-11-03T09:00:10Z")

</div>

Some additional details: if you're in a scenario with mixed 7.x and 8.x Elasticsearch server, using the Java API client 8.x _may_ work with Elasticsearch server 7.x.

However, you will get better compatibility using the Java API client 7.x with Elasticsearch 8.x. The Java API client 7.x will send the necessary headers so that [Elasticsearch server 8.x works in 7.x compatible mode](https://www.elastic.co/guide/en/elasticsearch/reference/8.5/rest-api-compatibility.html).

---

<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 1, 2022, 9:00am UTC](https://discuss.elastic.co/t/java-api-client-8-x-with-elasticsearch-7-x/318000/6 "2022-12-01T09:00:26Z")

</div>

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