Analysis-icu Plugin won't install

trying to install the ICU-Plugin in elasticsearch 5.0.0 with the command given in the documentation (sudo bin/elasticsearch-plugin install analysis-icu) and get the following stack trace:

Exception in thread "main" java.lang.UnsupportedClassVersionError: org/elasticsearch/plugins/PluginCli : Unsupported major.minor version 52.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:803)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:482)

Is it that elasticsearch5.0.0 is running with JAVA8 and the plugin doesn't support that?

Please format your code using </> icon. It will make your post more readable.

Your config is probably wrong or something is not working as expected with the elasticsearch-plugin script.

What gives java -version?

You must have Java8 for sure.

on java -version I get the following:
java version "1.8.0_112"
Java(TM) SE Runtime Environment (build 1.8.0_112-b15)
Java HotSpot(TM) 64-Bit Server VM (build 25.112-b15, mixed mode)

What would I have to look for in the config?

Windows or Linux?

We are basically using this script: https://github.com/elastic/elasticsearch/blob/5.0/distribution/src/main/resources/bin/elasticsearch-plugin

So check:

  • $JAVA_HOME
  • and if not set what gives which java

I am working on Linux.

The execution of

  • echo $JAVA_HOME returns /opt/java8
    and
  • which java returns /opt/java8/bin/java

EDIT:
I've downloaded and extracted the .zip that is also referenced in the documentation
https://www.elastic.co/guide/en/elasticsearch/plugins/5.0/analysis-icu.html
into the plugins folder and it works fine.

Oh? I did not notice but you are using sudo.
So may be your root user does not have the right things.

What if?

sudo echo $JAVA_HOME
sudo which java

The manual thing can work yes but TBH I don't like it. It's hiding something wrong here.

The $JAVA_HOME Variable returns the same when i run it with sudo but "sudo which java" now returns

  • /usr/bin/java

I think that echo $JAVA_HOME is evaluated here before sudoing.

Whatever we can see that the root user is not aware of your Java8 install. This is my guess. I believe that if you run /usr/bin/java -version you will have a Java7 result?

Can you install the plugin without sudo?

Exactly that is the result :wink:

And I am able to install it via commandline when I drop the sudo.

Cheers for all the help, keep it up :slight_smile: