我必须如何安装/配置 Xuggle 才不会出现 UnsatisfiedLinkError?

发布于 2024-11-15 02:54:26 字数 1208 浏览 4 评论 0原文

我刚刚开始使用 Xuggle,我将所有内容下载到 Eclipse 中,并将它们包含在引用库中,但我做了一个非常简单的测试,

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)

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)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

青丝拂面 2024-11-22 02:54:26

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

在网上寻找答案时,您可能会因发现新旧版本的步骤混合而感到困惑。下面 (B) 中的步骤不再适用。

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


(A) 这适用于所有版本

来自Xuggler 文档

将 Xuggler 与 J2EE 容器结合使用
Xuggler 包含本机代码,因此需要使用 Tomcat、Jetty 或 Glassfish 等 J2EE 容器进行特殊安装。它必须安装在 J2EE 容器加载它的位置,而不是安装在特定的 Web 应用程序中(除非您可以保证您的应用程序是服务器中唯一加载 Xuggler 的应用程序)。您必须查找特定容器的特定文档,但作为示例,对于 Tomcat,请确保将 xuggle-xuggler.jar 文件安装到 $CATALINA_HOME/shared/lib。原因请参见 tomcat JNI 注释。


(B) 这仅适用于 XUGGLER PRE 5.2

来自:Xuggler 常见问题解答

java.lang.UnsatisfiedLinkError 是怎么回事?
这意味着Java找不到Xuggler本机库。检查以下内容:
你安装了 Xuggler 吗?

如果没有,请按照此处的说明进行操作

  • 环境变量 XUGGLE_HOME 是否已定义并指向您的 Xuggler 安装目录(在 Windows 上通常为 C:\Program Files\Xuggle,在 Linux/Mac 上通常为 /usr/local)?
  • 如果您在 Windows 上安装,安装后是否重新启动?
    您的 PATH 环境变量是否包含 Windows 上的 %XUGGLE_HOME%\bin 或 Linux/Mac 上的 $XUGGLE_HOME/bin?
  • Windows 上的 PATH 环境变量是否包含 %XUGGLE_HOME%\lib?
  • 您的 LD_LIBRARY_PATH 环境变量是否包含 Linux 上的 $XUGGLE_HOME/lib ?
  • 您的 DYLD_LIBRARY_PATH 环境变量是否包含 Mac OS-X 上的 $XUGGLE_HOME/lib?
  • 您使用的是 32 位 Java JVM,但使用的是 64 位版本的 Xuggler?或者是 64 位版本的 Java JVM 但 32 位版本的 Xuggler?不幸的是,这行不通。您需要确保匹配每个版本的“位数”。对不起。
    如果修复这些问题未能解决问题,请通过支持选项与我们联系。

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.
风轻花落早 2024-11-22 02:54:26

问题是我没有重新启动。 Mtyson 在他的回答中包含了这一点,所以他是正确的。

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文