I installed JOGL but why wont Eclipse recognize my

2019-08-29 13:07发布

问题:

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)

回答1:

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?



回答2:

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

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