【问题标题】:I installed JOGL but why wont Eclipse recognize my hello world program?我安装了 JOGL,但为什么 Eclipse 不能识别我的 hello world 程序?
【发布时间】:2012-02-17 19:31:41
【问题描述】:

我安装了 Jogl 并将其包含在 eclipse 的构建路径中,但它位于引用的库中。这是程序。

public class exceptionhandler
{ // open HelloWorld

    public static void main(String[] args)
    { // open main
        try
        { // open try
            System.loadLibrary("jogl");
            System.out.println("Hello World! (The native libraries are installed.)");
        } // close try
        catch (Exception e) // all try's need a catch
        { } // even if the catch does nothing
    } // close main

} // close HelloWorld

我没有包含导入,因为 Eclipse 无法识别它。所以当我运行它时,我得到了这个>

Exception in thread "main" java.lang.UnsatisfiedLinkError: no jogl in java.library.path
    at java.lang.ClassLoader.loadLibrary(Unknown Source)
    at java.lang.Runtime.loadLibrary0(Unknown Source)
    at java.lang.System.loadLibrary(Unknown Source)
    at exceptionhandler.main(exceptionhandler.java:8)

【问题讨论】:

标签: java eclipse jogl


【解决方案1】:

您确定您使用的是最新版本的 JOGL?您是否也下载了包含本机库的 JAR?有没有把它们和jogl-all.jar 和gluegen-rt.jar 放在同一个目录下?

【讨论】:

    【解决方案2】:

    您是否在 Eclipse 构建路径设置中指定了 jogl.dll 的路径?

    有关说明,请参阅 https://stackoverflow.com/a/958074/1216956

    【讨论】:

    • 自 JOGL 的第二个版本以来,不再强制在 Eclipse 中设置 Java 库路径或“本机库”。包含本机库的 JAR 必须与包含类(jogl-all.jar 和gluegen-rt.jar)的 JAR 位于同一目录中。请遵循以下说明:jogamp.org/wiki/index.php/…
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2010-11-11
    • 1970-01-01
    • 2011-03-06
    • 1970-01-01
    • 1970-01-01
    • 2019-12-11
    相关资源
    最近更新 更多