# Is the new opensearch-java client v.2.9.0 supposed to work with Java 8?

**URL:** <https://forum.opensearch.org/t/is-the-new-opensearch-java-client-v-2-9-0-supposed-to-work-with-java-8/18079>\
**Category:** OpenSearch Client Libraries\
**Tags:** opensearch-java\
**Created:** [February 26, 2024, 1:21pm UTC](https://forum.opensearch.org/t/is-the-new-opensearch-java-client-v-2-9-0-supposed-to-work-with-java-8/18079 "2024-02-26T13:21:38Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hrvojeee](https://avatars.discourse-cdn.com/v4/letter/h/96bed5/32.png) [@Hrvojeee](https://forum.opensearch.org/u/Hrvojeee)\
**Post date:** [February 26, 2024, 1:21pm UTC](https://forum.opensearch.org/t/is-the-new-opensearch-java-client-v-2-9-0-supposed-to-work-with-java-8/18079/1 "2024-02-26T13:21:38Z")

</div>

**Versions** (relevant - OpenSearch/Dashboard/Server OS/Browser):

```auto
<dependency>
    <groupId>org.opensearch.client</groupId>
    <artifactId>opensearch-java</artifactId>
    <version>2.9.0</version>
</dependency>

```

**Describe the issue** :  
I am trying to use the newly released (22.2.2024) opensearch-java client 2.9.0 in a project as a dependency. When I try to instantiate either the Rest Client transport or the AwsSdk2Transport per docs [Java client - OpenSearch Documentation](https://opensearch.org/docs/latest/clients/java/#installing-the-client-using-restclient-transport) , my project compiles fine against Java 8 but when I run the app with Java8 I get this

```auto
nested exception is java.lang.UnsupportedClassVersionError: org/opensearch/client/util/ObjectBuilder has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0

```

Was the opensearch-java compiled with JDK11 or I’m doing something wrong or I missed the whole point of the Java8 support feature mentioned here [[PROPOSAL] Restore support for Java 8 · Issue #156 · opensearch-project/opensearch-java (github.com)](https://github.com/opensearch-project/opensearch-java/issues/156) ?

**Configuration** :  
Java 8 project using opensearch-client v.2.9.0 to work with Opensearch serverless on AWS.

**Relevant Logs or Screenshots** :  
During runtime of the application with Java 8:

```auto
nested exception is java.lang.UnsupportedClassVersionError: org/opensearch/client/util/ObjectBuilder has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0

```

---

<div class="post-metadata">

**Author:** ![Hrvojeee](https://avatars.discourse-cdn.com/v4/letter/h/96bed5/32.png) [@Hrvojeee](https://forum.opensearch.org/u/Hrvojeee)\
**Post date:** [February 26, 2024, 2:36pm UTC](https://forum.opensearch.org/t/is-the-new-opensearch-java-client-v-2-9-0-supposed-to-work-with-java-8/18079/2 "2024-02-26T14:36:29Z")

</div>

This is my mistake, i had the old opensearch-java on my classpath. When i did some mvn cleans its working fine. This should be closed.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex019/uploads/mauve_hedgehog/original/2X/3/33547ea01a5b12dcca2958411d3edd97ae2ea8c1.png) [@system](https://forum.opensearch.org/u/system)\
**Post date:** [April 26, 2024, 2:36pm UTC](https://forum.opensearch.org/t/is-the-new-opensearch-java-client-v-2-9-0-supposed-to-work-with-java-8/18079/3 "2024-04-26T14:36:49Z")

</div>

Closed on April 26, 2024, 2:36pm UTC

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