How do I have to install/configure Xuggle to not get an UnsatisfiedLinkError?
Asked Answered
T

2

6

I am JUST getting started with Xuggle and I downloaded everything into Eclipse and I included them in them in the Referenced Libraries but I made a really simple test,

package com.xuggle.xuggler.demos;
import com.xuggle.xuggler.IContainer;

public class getContainerInfo {
public static void main (String [] args){

     IContainer myContainer = IContainer.make();
    }
}

and it throws a bunch of errors,

2011-06-12 16:26:52,142 [main] ERROR com.xuggle.ferry.JNILibraryLoader - Could not load library: xuggle-xuggler; version: 3; Visit http://www.xuggle.com/xuggler/faq/ to find common solutions to this problem
Exception in thread "main" java.lang.UnsatisfiedLinkError: no xuggle-xuggler in java.library.path
    at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1734)
    at java.lang.Runtime.loadLibrary0(Runtime.java:823)
    at java.lang.System.loadLibrary(System.java:1028)
    at com.xuggle.ferry.JNILibraryLoader.loadLibrary0(JNILibraryLoader.java:265)
    at com.xuggle.ferry.JNILibraryLoader.loadLibrary(JNILibraryLoader.java:168)
    at com.xuggle.xuggler.XugglerJNI.<clinit>(XugglerJNI.java:19)
    at com.xuggle.xuggler.IContainer.<clinit>(IContainer.java:1457)
    at com.xuggle.xuggler.demos.getContainerInfo.main(getContainerInfo.java:9)
Tamtam answered 12/6, 2011 at 20:32 Comment(4)
mybe this will help - #958200Desiraedesire
The stack trace suggests: "Visit xuggle.com/xuggler/faq to find common solutions to this problem". Did you do that?Saxena
I got it I just forgot to follow some steps in the installation process. Thanks so much!Tamtam
@Tyler: Could you post your solution (e.g. what steps were actually necessary in the installation) as an answer?Incretion
C
10

Below is what I've found. There is confusion because as of Xuggler 5.2 and greater, you don't need to install it and set the environment variables.

When looking at the web for answers, you may be confused by finding a mixture of steps from old and new versions. The steps from (B) below, no longer apply.

I myself finally fixed the problem by making sure the jar was in the J2EE containers lib, and upgrading from Xuggler 5.2 to 5.4. Thereafter, the link error was gone.


(A) THIS APPLIES TO ALL VERSIONS
From the Xuggler Docs:

Using Xuggler with J2EE Containers
Xuggler contains Native Code and therefore requires special installation with J2EE containers such as Tomcat, Jetty or Glassfish. It must be installed in a location where the J2EE container loads it, rather than a specific web application (unless you can guarantee that your application is the only application in the server that will load Xuggler). You will have to look up the specific documentation for your specific container, but as an example, for Tomcat make sure you install xuggle-xuggler.jar file to $CATALINA_HOME/shared/lib. See tomcat JNI notes for the reason why.


(B) THIS APPLIES ONLY TO XUGGLER PRE 5.2
From: Xuggler Faq:

What's up with java.lang.UnsatisfiedLinkError?
It means that Java can't find the Xuggler native library. Check the following:
Did you install the Xuggler?
If not, follow the instructions here

  • Is the environment variable XUGGLE_HOME defined and pointing to your Xuggler install directory (usually C:\Program Files\Xuggle on Windows or /usr/local on Linux/Mac)?
  • If you installed on Windows, did you reboot after you installed? Does your PATH environment variable include %XUGGLE_HOME%\bin on Windows or $XUGGLE_HOME/bin on Linux/Mac?
  • Does your PATH environment variable include %XUGGLE_HOME%\lib on Windows?
  • Does your LD_LIBRARY_PATH environment variable include $XUGGLE_HOME/lib on Linux?
  • Does your DYLD_LIBRARY_PATH environmentvariable include $XUGGLE_HOME/lib on Mac OS-X?
  • Are you using a 32-bit Java JVM, but a 64-bit version of Xuggler? Or a 64-bit version of the Java JVM but a 32-bit version of Xuggler? Unfortunately that won't work. You need to make sure that you match the "bitness" of each release. Sorry. If fixing those problems doesn't resolve the issue, please contact us via the Support options.
Clachan answered 13/7, 2012 at 18:52 Comment(1)
+1 nice answer, to add on now we need to compile source code for xuggle by over own xuggle.com/xuggler/buildPellucid
T
3

The issue was that I didn't reboot. Mtyson included this in his answer, so he's correct.

Tamtam answered 2/4, 2014 at 21:36 Comment(1)
this should be commentPellucid

© 2022 - 2024 — McMap. All rights reserved.