Maven 项目:无法在 Eclispe 中使用外部 jar(UnsatisfiedLinkError)

Maven project: Can't use external jar in Eclispe (UnsatisfiedLinkError)

我正在尝试在 Maven 项目中使用外部 jar JOGL 和 GlueGen。当 运行 Eclipse 中的代码时,我收到此错误消息:

error message

我将两个外部 jar 作为依赖项包含在 pom.xml 中。

<dependencies>
    <!-- JOGL & Gluegen -->
    <dependency>
        <groupId>org.jogamp.gluegen</groupId>
        <artifactId>gluegen-rt</artifactId>
        <version>2.3.2</version>
    </dependency>
    <dependency>
        <groupId>org.jogamp.jogl</groupId>
        <artifactId>jogl-all-main</artifactId>
        <version>2.3.2</version>
    </dependency>
</dependencies>

奇怪的是,其他外部 jar(例如 Guava)作为从 Maven 的中央存储库加载的依赖项包含在工作正常中。

非常感谢帮助解决此问题。

您应该像我一样使用工件 ID gluegen-rt-main 而不是 gluegen-rtMaven build file of JogAmp's Ardor3D Continuation

如果这还不够,您将不得不停止使用 Maven 并可能禁用自动本机库加载 (this is explained in the JOGL user's guide)。