tags:

views:

4868

answers:

3

I'm trying to use JVLC but I can't seem to get it work. I've downloaded the jar, I installed VLC and passed the -D argument to the JVM telling it where VLC is installed. I also tried:

NativeLibrary.addSearchPath("libvlc", "C:\\Program Files\\VideoLAN\\VLC");

with no luck. I always get:

Exception in thread "main" java.lang.UnsatisfiedLinkError: Unable to load library 'libvlc': The specified module could not be found.

Has anyone made it work?

+1  A: 

You can get that exception if the dll you are trying to load requires other dlls that are not available. Sorry I can't be of more specific help, but it is something to check out. You can use depends to walk the dll dependancies.

Steve g
+1  A: 

Not sure about that NativeLibrary class. Typically when using native libraries, you need to set the system property, "java.library.path", to the location of your native libraries. As suggested, if your native library (dll, so, etc) depends on additional native libraries then the OS will takeover to resolve these dependencies. The OS will have no clue about java.library.path and beging by searching the OS specific path for native libraries. On windows this includes the current PATH environment variable as well as System32 in the windows directory. On linux this is the LD_LIBRARY_PATH / ld.conf setup.

Try setting the PATH (LD_LIBRARY_PATH) to point to the same location as java.library.path. The only catch is that you can't set this one your process launches (the JVM), it's already too late. You need to have the environment set BEFORE the JVM launches. You can do this vis batch files, shell scripts, Ant, or directly from your IDE.

basszero
+1  A: 

Hi, I am a total loss with this but look at this link http://www.neophob.com/serendipity/index.php?/archives/166-jVLC-Fun-with-VLC-4-Java.html

mentioning something off: Last hint for Java devs: jVLC needs the JNA (Java Native Access) to work.

Good Luck

LionShareMedia sa

LionShareMedia sa