Search code examples
javalinuxintellij-ideajogl

Exception while setting up JOGL with IntelliJ


this is my first question on stackoverflow so please forgive me if I am not specific enough but I'll give my best. So here's my problem: For 3 hours I've been trying to setup jogl with IntelliJ. Followed the instructions on the jogl installation homepage for my OS and IntelliJ recognizes all OpenGL classes without problems. Source code is being read without errors but here's the thing: When I try to start my program I get this error:

Exception in thread "AWT-EventQueue-0" java.lang.UnsatisfiedLinkError: /tmp/jogamp_0000/file_cache/jln3160951728563156885/jln8316311171870168112/natives/linux-amd64/libnativewindow_awt.so: /usr/lib/jvm/java-13-oracle/lib/libjawt.so: version `SUNWprivate_1.1' not found (required by /tmp/jogamp_0000/file_cache/jln3160951728563156885/jln8316311171870168112/natives/linux-amd64/libnativewindow_awt.so)
    at java.base/java.lang.ClassLoader$NativeLibrary.load0(Native Method)
    at java.base/java.lang.ClassLoader$NativeLibrary.load(ClassLoader.java:2440)
    at java.base/java.lang.ClassLoader$NativeLibrary.loadLibrary(ClassLoader.java:2497)
    at java.base/java.lang.ClassLoader.loadLibrary0(ClassLoader.java:2694)
    at java.base/java.lang.ClassLoader.loadLibrary(ClassLoader.java:2627)
    at java.base/java.lang.Runtime.load0(Runtime.java:744)
    at java.base/java.lang.System.load(System.java:1873)
    at com.jogamp.common.jvm.JNILibLoaderBase.loadLibraryInternal(JNILibLoaderBase.java:603)
    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 jogamp.nativewindow.NWJNILibLoader.access$000(NWJNILibLoader.java:39)
    at jogamp.nativewindow.NWJNILibLoader$1.run(NWJNILibLoader.java:49)
    at jogamp.nativewindow.NWJNILibLoader$1.run(NWJNILibLoader.java:41)
    at java.base/java.security.AccessController.doPrivileged(AccessController.java:312)
    at jogamp.nativewindow.NWJNILibLoader.loadNativeWindow(NWJNILibLoader.java:41)
    at jogamp.nativewindow.jawt.JAWTUtil.<clinit>(JAWTUtil.java:336)
    at java.base/java.lang.Class.forName0(Native Method)
    at java.base/java.lang.Class.forName(Class.java:416)
    at com.jogamp.nativewindow.NativeWindowFactory$3.run(NativeWindowFactory.java:344)
    at com.jogamp.nativewindow.NativeWindowFactory$3.run(NativeWindowFactory.java:340)
    at java.base/java.security.AccessController.doPrivileged(AccessController.java:312)
    at com.jogamp.nativewindow.NativeWindowFactory.initSingleton(NativeWindowFactory.java:340)
    at com.jogamp.opengl.GLProfile.initProfilesForDefaultDevices(GLProfile.java:1721)
    at com.jogamp.opengl.GLProfile.access$000(GLProfile.java:80)
    at com.jogamp.opengl.GLProfile$1.run(GLProfile.java:230)
    at java.base/java.security.AccessController.doPrivileged(AccessController.java:312)
    at com.jogamp.opengl.GLProfile.initSingleton(GLProfile.java:216)
    at com.jogamp.opengl.GLProfile.getProfileMap(GLProfile.java:2297)
    at com.jogamp.opengl.GLProfile.get(GLProfile.java:988)
    at com.jogamp.opengl.GLProfile.getDefault(GLProfile.java:722)
    at com.jogamp.opengl.GLProfile.getDefault(GLProfile.java:733)
    at PongGame.run(Pong3DTex.java:217)
    at Pong3DTex$1.run(Pong3DTex.java:1028)
    at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:313)
    at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:770)
    at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721)
    at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:715)
    at java.base/java.security.AccessController.doPrivileged(AccessController.java:391)
    at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
    at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:740)
    at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
    at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
    at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
    at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
    at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
    at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)'"

And I have literally no clue about what is happening, why this is happening and what 'SUNWprivate_1.1' is supposed to be. The line the exception is referring to says: GLProfile glp = GLProfile.getDefault(); which is like literally the first line that's executed in my code.

This is all happening on my Laptop running the latest version of elementaryOS and I am pretty new to Linux so I am totally overwhelmed atm. On Windows everything worked fine when I told IntelliJ the path to the jar folder of jogl and that was it.

So I really hope you guys can help me because I am at the end of my wisdom. Thanks for every answer.


Solution

  • Alright. So after 6 hours of research, reinstalling java/jogl over and over again I found the problem: I used oracle jdk13, which doesn't seem to be compatible with jogl on linux so i uninstalled jdk13 and downloaded open jdk 11 instead. Still doesn't wort but i get a different exception message. Threw away open jdk 11 and installed open jdk 8 instead et voila -> IT FINALLY WORKS. 8 Hours I had to use for study wasted on such a crap. Why can't stuff just work on linux? why does there always have to be some hidden bs that's stopping you from doing the things you need to do? – CaptainIceBl0ck 24 mins ago