caprica / vlcj

Java framework for the vlc media player
http://www.capricasoftware.co.uk/projects/vlcj
1.1k stars 260 forks source link

When libvlc.so is a link to a shared library, file.exists() returns false and crashes the program #1191

Closed chikapachimecho closed 1 year ago

chikapachimecho commented 1 year ago

This is the error I get "Native library (linux-x86-64/libvlc.so) not found in resource path." It looks like a problem when using NativeLibrary in jna-jpms:5.12.1.

Exception in thread "main" java.lang.UnsatisfiedLinkError: Unable to load library 'vlc': libvlc.so: cannot open shared object file: No such file or directory libvlc.so: cannot open shared object file: No such file or directory Native library (linux-x86-64/libvlc.so) not found in resource path at com.sun.jna.NativeLibrary.loadLibrary(NativeLibrary.java:307) at com.sun.jna.NativeLibrary.getInstance(NativeLibrary.java:467) at com.sun.jna.Native.register(Native.java:1774) at com.sun.jna.Native.register(Native.java:1493) at uk.co.caprica.vlcj.binding.lib.LibVlc.(LibVlc.java:99) at uk.co.caprica.vlcj.support.version.LibVlcVersion.(LibVlcVersion.java:49) at uk.co.caprica.vlcj.factory.MediaPlayerFactory.checkVersion(MediaPlayerFactory.java:195) at uk.co.caprica.vlcj.factory.MediaPlayerFactory.discoverNativeLibrary(MediaPlayerFactory.java:181) at uk.co.caprica.vlcj.factory.MediaPlayerFactory.(MediaPlayerFactory.java:108) at uk.co.caprica.vlcj.factory.MediaPlayerFactory.(MediaPlayerFactory.java:132) at uk.co.caprica.vlcj.player.component.EmbeddedMediaPlayerComponent.initMediaPlayerFactory(EmbeddedMediaPlayerComponent.java:125) at uk.co.caprica.vlcj.player.component.EmbeddedMediaPlayerComponent.(EmbeddedMediaPlayerComponent.java:77) at uk.co.caprica.vlcj.player.component.EmbeddedMediaPlayerComponent.(EmbeddedMediaPlayerComponent.java:120)

caprica commented 1 year ago

I don't think this is a vlcj problem as such, since JNA doesn't really load the native library, it is instead either JNA or the JVM itself.

How did you install VLC?