# JRE 5 ElasticSearch Client?

**URL:** <https://discuss.elastic.co/t/jre-5-elasticsearch-client/9609>\
**Category:** Elasticsearch\
**Created:** [November 7, 2012, 9:21pm UTC](https://discuss.elastic.co/t/jre-5-elasticsearch-client/9609 "2012-11-07T21:21:11Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Andy\_3](https://avatars.discourse-cdn.com/v4/letter/a/c57346/32.png) [@Andy\_3](https://discuss.elastic.co/u/Andy_3)\
**Post date:** [November 7, 2012, 9:21pm UTC](https://discuss.elastic.co/t/jre-5-elasticsearch-client/9609/1 "2012-11-07T21:21:11Z")

</div>

Has anyone ever tried to build a Java5 Elastic Search Client? I'm stuck on  
Java5 for the time being, so I need to find one or build my own.

Thanks for any response.

--

---

<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:** [November 7, 2012, 9:35pm UTC](https://discuss.elastic.co/t/jre-5-elasticsearch-client/9609/2 "2012-11-07T21:35:22Z")

</div>

Hey Andy,

I'm on the way of building a SPORE specification for elasticsearch.  
I will check if jspore works also on Java5.

Here's my github repo: [GitHub - dadoonet/spore-elasticsearch: SPORE specifications for elasticsearch](https://github.com/dadoonet/spore-elasticsearch)

Hope this could help (in the next future)

--  
David 😉  
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 7 nov. 2012 à 22:21, Andy [apryor48@gmail.com](mailto:apryor48@gmail.com) a écrit :

> Has anyone ever tried to build a Java5 Elastic Search Client? I'm stuck on Java5 for the time being, so I need to find one or build my own.
> 
> ## Thanks for any response.

--

---

<div class="post-metadata">

**Author:** ![jprante](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jprante/32/44941_2.png) [@jprante](https://discuss.elastic.co/u/jprante)\
**Post date:** [November 8, 2012, 12:40pm UTC](https://discuss.elastic.co/t/jre-5-elasticsearch-client/9609/3 "2012-11-08T12:40:10Z")

</div>

Interesting idea!

I am working on codebase modularization and I'm busy with a TransportClient  
API compatible HTTP client [GitHub - jprante/elasticsearch-client: Modularized, OpenJDK 11 version of Elasticsearch client](https://github.com/jprante/elasticsearch-client)  
it's not yet released yet.

A quick try on JDK 5 compilation gave me several issues: you have to fall  
back to Guava 11 (it's the last Java 5 version), some modifications are  
necessary regarding JDK features (backport of concurrency utils jsr166y is  
an example)

Maybe more issues will arise when the beast is running. I will try if I can  
set up a JDK 5 build profile...

David, thanks for the SPORE effort. Nice! I am traversing the ES code to  
also pick up the HTTP request parameters and the response format. Most is  
well, but I had to add some more request/response classes for the  
parameters and switched some meber methods from protected to public access

- a few bits are missing in the ES code to make the REST API clean, so I  
think about pull requests to the master code.

Best regards,

Jörg

On Wednesday, November 7, 2012 10:21:11 PM UTC+1, Andy wrote:

> Has anyone ever tried to build a Java5 Elastic Search Client? I'm stuck  
> on Java5 for the time being, so I need to find one or build my own.
> 
> Thanks for any response.

--

---

<div class="post-metadata">

**Author:** ![jprante](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jprante/32/44941_2.png) [@jprante](https://discuss.elastic.co/u/jprante)\
**Post date:** [November 9, 2012, 11:06am UTC](https://discuss.elastic.co/t/jre-5-elasticsearch-client/9609/4 "2012-11-09T11:06:37Z")

</div>

I'd like to share some impressions of the issues while I am building a  
TransportClient API compatible ES client for jdk5.

- good news: Lucene 3.6.1 is jdk5 compatible, Guava 13 delivers a separate  
jdk5 jar, Jackson is jdk5 compatible (except the YAML build, surprisingly),  
and Netty 3.5.8 is jdk5 compatible

- the client codebase of ES makes use of jdk6 enhancements in java.util and  
[java.net](http://java.net) which are not present in a JRE 5 (concurrency, arrays, network  
layer requests e.g.).

- Charset.forName is not present in jdk5, string encoding must use  
getBytes("UTF-8") with the famous UnsupportedEncodingException

- the source code syntax need to get cleaned so a jdk5 compiler does not  
bail out (lots of @Overrides on interface methods)

- The missing jre6 parts need to be plugged in a separate jdk5 compat jar  
into the bootstrap class path for execution without SecurityException. The  
jdk5 compat classes would have to be modified copies from OpenJDK, under  
the OpenJDK license, which is GPL (with classpath exception, so ES won't  
have to be licensed under GPL)

- zen discovery (if ever required) would have to be replaced by a different  
thing. Maybe by a JGroups \< 2.9 based discovery plugin, which was the  
predecessor of zen discovery a long time ago. Last seen as a plugin for ES  
0.8.0, at kimchys googlecode svn repo  
[http://elasticsearch.googlecode.com/svn/plugins/discovery-jgroups/](http://elasticsearch.googlecode.com/svn/plugins/discovery-jgroups/)

- spatial4j requires a jdk5 rebuild. The builds are for jre6, but does not  
use Java 6 features

- I use java.util.ServiceLoader for pluggable compressor factories (lzf,  
snappy)

More to come,

Jörg

--

---

<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:** [July 6, 2017, 3:05am UTC](https://discuss.elastic.co/t/jre-5-elasticsearch-client/9609/5 "2017-07-06T03:05:10Z")

</div>


