# ElasticSearch 5.4.3 and Java 7

**URL:** <https://discuss.elastic.co/t/elasticsearch-5-4-3-and-java-7/165458>\
**Category:** Elasticsearch\
**Created:** [January 23, 2019, 4:57pm UTC](https://discuss.elastic.co/t/elasticsearch-5-4-3-and-java-7/165458 "2019-01-23T16:57:17Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![YohanTaton](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/yohantaton/32/40139_2.png) [@YohanTaton](https://discuss.elastic.co/u/YohanTaton)\
**Post date:** [January 23, 2019, 4:57pm UTC](https://discuss.elastic.co/t/elasticsearch-5-4-3-and-java-7/165458/1 "2019-01-23T16:57:17Z")

</div>

Hi guys,

We have been using an old version of ELK and our customer has decided to migrate to ELK 5.4.3 but keeping Java 7 for the moment. (Migration to Java 8 is indeed planned, but Java 7 is going to be used for few year ahead).

Our dependency to ElasticSearch (query mechanism) is made via maven:  
  
org.elasticsearch.client  
transport  
5.4.3

Our Java class relies on the following ElasticSearch classes:  
import org.elasticsearch.action.search.SearchRequestBuilder;  
import org.elasticsearch.action.search.SearchResponse;  
import org.elasticsearch.action.search.SearchType;  
import org.elasticsearch.client.transport.TransportClient;  
import org.elasticsearch.common.settings.Settings;  
import org.elasticsearch.common.transport.InetSocketTransportAddress;  
import org.elasticsearch.index.query.BoolQueryBuilder;  
import org.elasticsearch.index.query.QueryBuilders;  
import org.elasticsearch.index.query.RangeQueryBuilder;  
import org.elasticsearch.search.SearchHit;  
import org.elasticsearch.search.SearchHitField;

Could you please advise how to make it work with Java 7?

Thanks in advance for your feedback.

Refs:

- [https://www.elastic.co/fr/support/matrix#matrix\_jvm](https://www.elastic.co/fr/support/matrix#matrix_jvm)
- [https://www.elastic.co/support/eol](https://www.elastic.co/support/eol)

---

<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:** [January 24, 2019, 3:54am UTC](https://discuss.elastic.co/t/elasticsearch-5-4-3-and-java-7/165458/2 "2019-01-24T03:54:21Z")

</div>

We don't support that mix of java and Elasticsearch, so the only real option is to upgrade java or not upgrade Elasticsearch.

---

<div class="post-metadata">

**Author:** ![Suryadip\_Nag](https://avatars.discourse-cdn.com/v4/letter/s/2bfe46/32.png) [@Suryadip\_Nag](https://discuss.elastic.co/u/Suryadip_Nag)\
**Post date:** [January 24, 2019, 4:43am UTC](https://discuss.elastic.co/t/elasticsearch-5-4-3-and-java-7/165458/3 "2019-01-24T04:43:17Z")

</div>

In our project we are using ES 5.5 and open jdk 1.8 but in the same host our application is running on java 1.7. So I believe you can upgrade ES and use openjdk8 for ES only.

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [January 24, 2019, 6:04am UTC](https://discuss.elastic.co/t/elasticsearch-5-4-3-and-java-7/165458/4 "2019-01-24T06:04:21Z")

</div>

If you are using the REST API that should be OK, but if you are using the transport client I think client and server need to run the same Java version.

---

<div class="post-metadata">

**Author:** ![YohanTaton](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/yohantaton/32/40139_2.png) [@YohanTaton](https://discuss.elastic.co/u/YohanTaton)\
**Post date:** [January 25, 2019, 12:26pm UTC](https://discuss.elastic.co/t/elasticsearch-5-4-3-and-java-7/165458/5 "2019-01-25T12:26:18Z")

</div>

Ok, indeed we are going to use REST API to be java version agnostic.

Thank you for your help.

---

<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 22, 2019, 12:26pm UTC](https://discuss.elastic.co/t/elasticsearch-5-4-3-and-java-7/165458/6 "2019-02-22T12:26:21Z")

</div>

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