Running Elasticsearch client with JDK 1.5?


(Thomas Peuss) #1

Hi!

We want to run an Elasticsearch Java Client (TransportClient) inside a
1.5 JVM. Unfortunately we have no control about the JVM version.

I have recompiled Elasticsearch for JDK 1.5. That worked without a
problem. BUT: Elasticsearch packages some third-party libs that seem
to be compiled with JDK 1.6. Is there a trick to get it running?
Falling back to HTTP REST is an option. But then I have to code all
the failover/retry/discovery stuff myself. I want to avoid that.

Greetings
Thomas


(Shay Banon) #2

Not really..., some libs are 1.6 so it will cause problems. I think the main
one is the jsr166 libs, that potentially can be complied with 1.5, but never
tried to.

On Tue, Oct 18, 2011 at 1:35 PM, Thomas Peuss thomas.peuss@nterra.comwrote:

Hi!

We want to run an Elasticsearch Java Client (TransportClient) inside a
1.5 JVM. Unfortunately we have no control about the JVM version.

I have recompiled Elasticsearch for JDK 1.5. That worked without a
problem. BUT: Elasticsearch packages some third-party libs that seem
to be compiled with JDK 1.6. Is there a trick to get it running?
Falling back to HTTP REST is an option. But then I have to code all
the failover/retry/discovery stuff myself. I want to avoid that.

Greetings
Thomas


(antonio.fernandez) #3

Hi all,

I´m in a situation very similar to Thomas , our client does not allow
upgrading to JDK 6.

@thomas : Could you help me to get ES compiled for JDK 1.5 ? What did
you do ? Thanks in advance

Without a solid knowledge about Gradle I tried modifying build.gradle
file :

plugins.withType(JavaPlugin).whenPluginAdded {
    sourceCompatibility = 1.5
    targetCompatibility = 1.5
    compileJava {
        sourceCompatibility = 1.5
        targetCompatibility = 1.5
        options.encoding = "UTF8"
    }

Compile process displays warnings but ends, and then when I run the
client I get the following exception :

Caused by: java.lang.UnsupportedClassVersionError: (org/elasticsearch/
common/util/concurrent/jsr166y/ThreadLocalRandom) bad major version at
offset=6

I think it would be interesting ES were compatible with JVM 1.5, but I
understand that other issues & features have more priority or
interest :slight_smile:

Greetings & Have a nice day,

On 18 oct, 17:26, Shay Banon kim...@gmail.com wrote:

Not really..., some libs are 1.6 so it will cause problems. I think the main
one is the jsr166 libs, that potentially can be complied with 1.5, but never
tried to.

On Tue, Oct 18, 2011 at 1:35 PM, Thomas Peuss thomas.pe...@nterra.comwrote:

Hi!

We want to run an Elasticsearch Java Client (TransportClient) inside a
1.5 JVM. Unfortunately we have no control about the JVM version.

I have recompiled Elasticsearch for JDK 1.5. That worked without a
problem. BUT: Elasticsearch packages some third-party libs that seem
to be compiled with JDK 1.6. Is there a trick to get it running?
Falling back to HTTP REST is an option. But then I have to code all
the failover/retry/discovery stuff myself. I want to avoid that.

Greetings
Thomas- Ocultar texto de la cita -

  • Mostrar texto de la cita -

(system) #4