Error setting up JOGL library

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Error setting up JOGL library

DannyWarp
The library cannot be used (Eclipse/Terminal)

Setting up tutorial in wiki is incomplete and useless.

Have a nice day.

dannywarp@HP-250-G6:~/Downloads/jogamp-all-platforms$ javac -classpath "jar/gluegen-rt.jar:jar/jogl-all.jar" RawGL2ES2demo.java

dannywarp@HP-250-G6:~/Downloads/jogamp-all-platforms$ java -classpath "jar/gluegen-rt.jar:jar/jogl-all.jar:." RawGL2ES2demo
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.jogamp.common.os.NativeLibrary$3 (file:/home/dannywarp/Downloads/jogamp-all-platforms/jar/gluegen-rt.jar) to method java.lang.ClassLoader.findLibrary(java.lang.String)
WARNING: Please consider reporting this to the maintainers of com.jogamp.common.os.NativeLibrary$3
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
Inconsistency detected by ld.so: dl-lookup.c: 111: check_match: Assertion `version->filename == NULL || ! _dl_name_match_p (version->filename, map)' failed!


dannywarp@HP-250-G6:~/Downloads/jogamp-all-platforms$ java -classpath "jar/gluegen-rt.jar:jar/jogl-all.jar:." -Djava.library.path=lib -Djogamp.gluegen.UseTempJarCache=false RawGL2ES2demo
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.jogamp.common.os.NativeLibrary$3 (file:/home/dannywarp/Downloads/jogamp-all-platforms/jar/gluegen-rt.jar) to method java.lang.ClassLoader.findLibrary(java.lang.String)
WARNING: Please consider reporting this to the maintainers of com.jogamp.common.os.NativeLibrary$3
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
Exception in thread "main" java.lang.UnsatisfiedLinkError: Can't load library: /home/dannywarp/Downloads/jogamp-all-platforms/natives/linux-amd64//libgluegen-rt.so
        at java.base/java.lang.ClassLoader.loadLibrary(ClassLoader.java:2630)
        at java.base/java.lang.Runtime.load0(Runtime.java:768)
        at java.base/java.lang.System.load(System.java:1837)
        at com.jogamp.common.jvm.JNILibLoaderBase.loadLibraryInternal(JNILibLoaderBase.java:624)
        at com.jogamp.common.jvm.JNILibLoaderBase.access$000(JNILibLoaderBase.java:63)
        at com.jogamp.common.jvm.JNILibLoaderBase$DefaultAction.loadLibrary(JNILibLoaderBase.java:106)
        at com.jogamp.common.jvm.JNILibLoaderBase.loadLibrary(JNILibLoaderBase.java:487)
        at com.jogamp.common.os.DynamicLibraryBundle$GlueJNILibLoader.loadLibrary(DynamicLibraryBundle.java:421)
        at com.jogamp.common.os.Platform$1.run(Platform.java:317)
        at java.base/java.security.AccessController.doPrivileged(Native Method)
        at com.jogamp.common.os.Platform.<clinit>(Platform.java:287)
        at com.jogamp.opengl.GLProfile.<clinit>(GLProfile.java:147)
        at RawGL2ES2demo.main(RawGL2ES2demo.java:246)
dannywarp@HP-250-G6:~/Downloads/jogamp-all-platforms$


dannywarp@HP-250-G6:~/Downloads/jogamp-all-platforms/etc$ ./test.sh
/usr/bin/java
openjdk version "11.0.9.1" 2020-11-04
OpenJDK Runtime Environment (build 11.0.9.1+1-Ubuntu-0ubuntu1.20.04)
OpenJDK 64-Bit Server VM (build 11.0.9.1+1-Ubuntu-0ubuntu1.20.04, mixed mode, sharing)
LIBXCB_ALLOW_SLOPPY_LOCK:
LIBGL_DRIVERS_PATH:
LIBGL_DEBUG:
java
CLASSPATH: jar/gluegen-rt.jar:jar/jogl-all.jar

Error: Could not find or load main class com.jogamp.newt.opengl.GLWindow
Caused by: java.lang.ClassNotFoundException: com.jogamp.newt.opengl.GLWindow
dannywarp@HP-250-G6:~/Downloads/jogamp-all-platforms/etc$
Reply | Threaded
Open this post in threaded view
|

Re: Error setting up JOGL library

gouessej
Administrator
This post was updated on .
Hello

There are multiple solutions:
- don't disable the automated native library loading and use jogamp-fat.jar (this JAR contains both the Java libraries and the native libraries), it works like a charm as you can see here
- disable the automated native library loading and set the Java library path as shown here, ensure that the directory used as the Java library path really contains the expected native libraries
- don't disable the automated native library loading and ensure that the JARs containing the native libaries of JOGL and GlueGen (gluegen-rt-natives-*-*.jar and jogl-all-natives-*-*.jar) are in the same directory than the JARs containing the Java libraries (jogl-all.jar and gluegen-rt.jar) as explained here

If nothing works, ensure that there is no paranoid virus scanner in your way (it doesn't seem to be your case as you seem to be under GNU Linux).

"Inconsistency detected by ld.so: dl-lookup.c: 111: check_match: Assertion `version->filename == NULL || ! _dl_name_match_p (version->filename, map)' failed!" might occur under some GNU Linux distributions. Please tell us which version of JOGL you use. Try to use the very latest release candidate of JOGL 2.4.

By the way, our tutorials aren't useless.
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: Error setting up JOGL library

gouessej
Administrator
In reply to this post by DannyWarp
Your problem seems to come from the OpenJDK build you use. I don't reproduce your problem under Mageia Linux because I use AdoptOpenJDK as explained here and here.

Good luck.
Julien Gouesse | Personal blog | Website