Search code examples
javaplayframeworkxuggle

How I can use Xuggler with Play! Framework


I was trying to use Xuggler ( http://www.xuggle.com/ ) with play! framework. I'm using Mac OSX and also created the ~/.MacOSX/environment.plist file with xuggler path. I also set these in my ~/.bashrc

export XUGGLE_HOME=/usr/local/xuggler
export LD_LIBRARY_PATH=$XUGGLE_HOME/lib

I put all the jars in the /lib folder of my play! application and updated the dependencies.yml like the following -

require:
    - play
    - provided -> xuggle-xuggler

repositories:
    - provided:
        type:       local
        artifact:   "${application.path}/lib/xuggle-xuggler.jar"
        contains:
            - provided -> *

BTW, I also ran play dependencies and it is still giving this error -

UnsatisfiedLinkError occured : no xuggle-xuggler in java.library.path

How can I fix this?


Solution

  • This error points to a problem with linking to a DLL file, so I checked the Xuggler docs for installation, and it had a section specifically to deal with this type of error.

    http://wiki.xuggle.com/Frequently_Asked_Questions#Installation_Questions

    It has the following, as a set of instructions you should follow to solve the error.

    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?
    • 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.