# Jakarta EE10 support

**URL:** <https://discuss.elastic.co/t/jakarta-ee10-support/360057>\
**Category:** Elasticsearch\
**Tags:** language-clients\
**Created:** [May 23, 2024, 8:42am UTC](https://discuss.elastic.co/t/jakarta-ee10-support/360057 "2024-05-23T08:42:59Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![tmonov-jug](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tmonov-jug/32/134744_2.png) [@tmonov-jug](https://discuss.elastic.co/u/tmonov-jug)\
**Post date:** [May 23, 2024, 8:43am UTC](https://discuss.elastic.co/t/jakarta-ee10-support/360057/1 "2024-05-23T08:43:00Z")

</div>

Do you have any plans to support Jakarta EE10 for elasticsearch-java?  
The latest artifact in Maven with GAV 'co.elastic.clients:elasticsearch-java:8.13.4'  
shows that has dependency to 'javax.annotation' but jakarta-platform-spec spec states about 'jakarta.annotation:jakarta.annotation-api:2.1.0' or later needed ('jakarta' namespace).

Thanks,  
Tihomir Monov

---

<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:** [May 23, 2024, 9:48am UTC](https://discuss.elastic.co/t/jakarta-ee10-support/360057/2 "2024-05-23T09:48:07Z")

</div>

The only annotation used is `javax.annotation.Nullable` to identify nullable parameters and return values meant to help IDEs and static code checking tools.

Is this causing an issue with Jakarta EE? Have you encountered a problem? If yes, can you describe it?

---

<div class="post-metadata">

**Author:** ![tmonov-jug](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tmonov-jug/32/134744_2.png) [@tmonov-jug](https://discuss.elastic.co/u/tmonov-jug)\
**Post date:** [May 23, 2024, 10:29am UTC](https://discuss.elastic.co/t/jakarta-ee10-support/360057/3 "2024-05-23T10:29:43Z")

</div>

We try use it as an OSGi bundle into Jakarta EE10 environment hence elasticsearch-java bundle has OSGi Manifest with  
`Import-Package: javax.annotation`  
dependency that cannot be satisfied into OSGi world as there aren't any bundle export such package into our Jakarta EE10 env. Lately will lead to ClassNotFoundException at runtime.

Thanks. T.

---

<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:** [May 23, 2024, 1:35pm UTC](https://discuss.elastic.co/t/jakarta-ee10-support/360057/4 "2024-05-23T13:35:45Z")

</div>

Is this a Jakarta EE issue or an OSGI issue? We do not provide OSGI bundle manifests, so where does this come from?

Can your issue be fixed by including the javax.annotation library in your bundle?

---

<div class="post-metadata">

**Author:** ![tmonov-jug](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tmonov-jug/32/134744_2.png) [@tmonov-jug](https://discuss.elastic.co/u/tmonov-jug)\
**Post date:** [May 27, 2024, 8:49am UTC](https://discuss.elastic.co/t/jakarta-ee10-support/360057/5 "2024-05-27T08:49:14Z")

</div>

It's a Jakarta EE issue, it should be `jakarta.*` as the namespace to replace `javax.*`. The OSGI bundle manifest is generated by the BND tool.  
I can fix the manifest by just make the import optional that will shift the problem to the runtime. Than I can provision the javax.annotation bundle at runtime as by chance it doesn't have any other 'javax' namespace dependencies. That will probably fix my problem but it just seems wrong mixing `jakarta.*` and `javax.*` for Jakarta EE.

---

<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:** [May 27, 2024, 10:01am UTC](https://discuss.elastic.co/t/jakarta-ee10-support/360057/6 "2024-05-27T10:01:19Z")

</div>

Ok, it's definitely an OSGi problem.

It's been a while since I last looked at OSGi, but it seems to me that something like adding `javax.annotation` as a `Private-Package` in the `.bnd` file you use to package the Java client could to the trick, by embedding that jar file in the bundle so that you don't have to deploy it in a dedicated bundle?
