javalinuxjava-8red5ant-media-server-sdk

Ant media server: Exception in thread "main" java.lang.UnsupportedClassVersionError


I have downloaded the installation files of the ant media server and now I am following this tutorial to try to run the server.
So I've run this command:

./start.sh

But, I keep getting this error:

Exception in thread "main" java.lang.UnsupportedClassVersionError: org/red5/server/Bootstrap has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 53.0

Here's the whole stack trace:
enter image description here

Running java -version gives me this:
enter image description here

Running javac -version gives me this:
enter image description here

The OS info is:
enter image description here

Any idea what's going-on?


I have tried installing java 8 by following the commands here:
enter image description here
So now when I run java -version, I get this:
enter image description here
But, I still get the same error.


FYI, when I run this command:

sudo update-alternatives --config java

This is what I get:
enter image description here
I have selected option 1. I have run the same commands for javac.
So now when I run java -version, I have this:
enter image description here
And when I run javac -version, I have this:
enter image description here
And I am still getting the same error.


The JAVA_HOME environment variable is also set to:

JAVA_HOME=/usr/lib/jvm/java-8-oracle


Solution

  • The error is telling you that the class was compiled with a newer version than the one you're running.

    You need to run it with Java 11 (version 55) but you are using Java 9 (version 53).