我安装了 JOGL,但为什么 Eclipse 无法识别我的 hello world 程序?

发布于 2025-01-06 12:24:19 字数 903 浏览 3 评论 0原文

我安装了 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)

i installed Jogl and included it in the build path of eclipse but it is under referenced libraries. Here is the program.

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

I did not include the import because Eclipse didn't recognize it. So when i do run it i get this>

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)

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

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

发布评论

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

评论(2

薄荷→糖丶微凉 2025-01-13 12:24:19

您确定您使用的是最新版本的 JOGL 吗?您是否也下载了包含本机库的 JAR?您是否将它们放入与 jogl-all.jar 和gluegen-rt.jar 相同的目录中?

Are you sure you use the latest version of JOGL? Have you downloaded the JARs containing the native libraries too? Have you put them into the same directory than jogl-all.jar and gluegen-rt.jar?

鹿! 2025-01-13 12:24:19

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

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

Have you specified the path to jogl.dll in the Eclipse build-path settings?

See https://stackoverflow.com/a/958074/1216956 for instructions.

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