Graylog not recognizing correct java version

graylog: 2.1.1
elastic: 4.2.2
mongo: 3.0.14

Updated from java 7 to java 8, removed java 7 from update-alternatives --config java for java, javac, and javaws. Elastic and mongo running fine, graylog is seeing the new version of java on the web interface and in the server.log:

2017-10-23T17:12:10.928-04:00 INFO [ServerBootstrap] Graylog server 2.1.2+50e449a starting up
2017-10-23T17:12:10.928-04:00 INFO [ServerBootstrap] JRE: Oracle Corporation 1.8.0_152 on Linux 3.16.0-4-amd64
2017-10-23T17:12:10.928-04:00 INFO [ServerBootstrap] Deployment: deb
2017-10-23T17:12:10.928-04:00 INFO [ServerBootstrap] OS: Debian GNU/Linux 8 (jessie) (debian)
2017-10-23T17:12:10.929-04:00 INFO [ServerBootstrap] Arch: amd64

Trying to upgrade graylog manually to 2.3.2 with the tarball, but it will not run and is throwing the following error, which is exactly the same as this issue posted:
https://github.com/Graylog2/graylog2-server/issues/2256

Exception in thread “main” java.lang.UnsupportedClassVersionError: org/graylog2/bootstrap/Main : Unsupported major.minor version 52.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:800)
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)

root@XXXXX:/home/XXXXX_user# update-alternatives --config javaws
There is only one alternative in link group javaws (providing /usr/bin/javaws): /usr/lib/jvm/jdk1.8.0_152/bin/javaws
Nothing to configure.
root@XXXXX:/home/XXXXX_user# update-alternatives --config javac
There is only one alternative in link group javac (providing /usr/bin/javac): /usr/lib/jvm/jdk1.8.0_152/bin/javac
Nothing to configure.
root@XXXXX:/home/XXXXX_user# update-alternatives --config java
There are 3 choices for the alternative java (providing /usr/bin/java).

Selection Path Priority Status

  • 0 /usr/lib/jvm/jdk1.8.0_152/bin/java 100 auto mode
    1 /opt/jdk/bin/java 1 manual mode
    2 /usr/lib/jvm/jdk1.8.0_152/bin/java 100 manual mode
    3 /usr/lib/jvm/jre1.8.0_152/bin/java 100 manual mode

Press enter to keep the current choice[*], or type selection number: ^C

root@XXXXX:/home/XXXXX_user# java -version
java version "1.8.0_152"
Java™ SE Runtime Environment (build 1.8.0_152-b16)
Java HotSpot™ 64-Bit Server VM (build 25.152-b16, mixed mode)

root@XXXXX:/home/XXXXX_user# javac -version
javac 1.8.0_152

How exactly are you starting Graylog?
Are you sure that only Java 8 is installed on your system?
What’s the content of the ${JAVA_HOME} environment variable?

you’re right, it’s showing bash: /usr/lib/jvm/java-7-oracle: when i pull up the env variable. going to change it and see what happens

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