0

I have downloaded the ant-media-server files and tried to launch the server.
But, I recently learned that Ant Media Server requires java 11.
So I updated the java version to java 11:
So when I run this command:

java -version

This is the result:

openjdk version "11.0.11-ea" 2021-04-20

OpenJDK Runtime Environment (build 11.0.11-ea+4-Ubuntu-0ubuntu3.16.04.1)

OpenJDK 64-Bit Server VM (build 11.0.11-ea+4-Ubuntu-0ubuntu3.16.04.1, mixed mode, sharing)

And when I run this command:

javac -version

This is the result:

javac 11.0.11-ea

When I try to launch the Ant Media Server, this is the result I get:

Bootstrap exception: null
java.lang.reflect.InvocationTargetException
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:566)
    at org.red5.server.Bootstrap.bootStrap(Bootstrap.java:122)
    at org.red5.server.Bootstrap.main(Bootstrap.java:50)
Caused by: java.lang.UnsatisfiedLinkError: no jniavutil in java.library.path: [/home/ahmed/Desktop/CodingPlayground/ant_media_server/ant_media_server/lib/native]
    at java.base/java.lang.ClassLoader.loadLibrary(ClassLoader.java:2670)
    at java.base/java.lang.Runtime.loadLibrary0(Runtime.java:830)
    at java.base/java.lang.System.loadLibrary(System.java:1873)
    at org.bytedeco.javacpp.Loader.loadLibrary(Loader.java:1683)
    at org.bytedeco.javacpp.Loader.load(Loader.java:1300)
    at org.bytedeco.javacpp.Loader.load(Loader.java:1123)
    at org.bytedeco.ffmpeg.global.avutil.<clinit>(avutil.java:14)
    at org.red5.server.Launcher.launch(Launcher.java:65)
    ... 6 more
Caused by: java.lang.UnsatisfiedLinkError: /home/ahmed/.javacpp/cache/ffmpeg-4.3.1-1.5.4-linux-x86_64.jar/org/bytedeco/ffmpeg/linux-x86_64/libjniavutil.so: libva-drm.so.2: cannot open shared object file: No such file or directory
    at java.base/java.lang.ClassLoader$NativeLibrary.load0(Native Method)
    at java.base/java.lang.ClassLoader$NativeLibrary.load(ClassLoader.java:2442)
    at java.base/java.lang.ClassLoader$NativeLibrary.loadLibrary(ClassLoader.java:2498)
    at java.base/java.lang.ClassLoader.loadLibrary0(ClassLoader.java:2694)
    at java.base/java.lang.ClassLoader.loadLibrary(ClassLoader.java:2627)
    at java.base/java.lang.Runtime.load0(Runtime.java:768)
    at java.base/java.lang.System.load(System.java:1837)
    at org.bytedeco.javacpp.Loader.loadLibrary(Loader.java:1633)
    ... 10 more

Any idea what's going on?


EDIT 1:
When I checked the JAVA_HOME environment variable, I found-out, it still points to java-8 files:

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

So I tried to see the files in /usr/lib/jvm, and this is what I found:
enter image description here So maybe this is causing the problem?
I don't know to which file should I make JAVA_HOME point to instead.


EDIT 2:

I opened /etc/environment and modified JAVA_HOME to this:

JAVA_HOME='/usr/lib/jvm/java-11-openjdk-amd64'

I also changed it globally by running:

export JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64

And, I am still getting the same error.

AG_HIHI
  • 1,432
  • 2
  • 19
  • 35
  • It looks like it needs to load `libva-drm.so.2`, but that's not required by the default builds, so you must be using a custom build. Try to use the default build or install `libva-drm.so.2` on your system. – Samuel Audet Mar 12 '21 at 01:10

1 Answers1

-2

check variables in /etc/profile you may set java environment strong textvariables like this:

export JAVA_HOME=/usr/share/jdk1.6.0_14
export PATH=$JAVA_HOME/bin:$PATH
export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar