加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 编程开发 > Java > 正文

java – 如何安装/配置Xuggle以获取UnsatisfiedLinkError?

发布时间:2020-12-15 02:49:11 所属栏目:Java 来源:网络整理
导读:我刚刚开始使用Xuggle,我已将所有内容下载到 Eclipse中,并将其包含在Referenced Libraries中,但我做了一个非常简单的测试, package com.xuggle.xuggler.demos;import com.xuggle.xuggler.IContainer;public class getContainerInfo {public static void main
我刚刚开始使用Xuggle,我已将所有内容下载到 Eclipse中,并将其包含在Referenced Libraries中,但我做了一个非常简单的测试,
package com.xuggle.xuggler.demos;
import com.xuggle.xuggler.IContainer;

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

     IContainer myContainer = IContainer.make();
    }
}

它会引发一堆错误,

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)

解决方法

以下是我发现的.存在混淆,因为从Xuggler 5.2及更高版本开始,您不需要安装它并设置环境变量.

在网上查找答案时,您可能会因为找到旧版本和新版本的混合步骤而感到困惑.以下(B)的步骤不再适用.

我自己最终通过确保jar在J2EE容器lib中,并从Xuggler 5.2升级到5.4来解决问题.此后,链接错误消失了.

(A)这适用于所有版本
从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)这仅适用于XUGGLER PRE 5.2
来自: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 FilesXuggle 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.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读