jogl 2.4 and Java 17: Index -1 out of bounds for length 1

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

jogl 2.4 and Java 17: Index -1 out of bounds for length 1

wolfgang-ch
When running WorldWind Java v2.2.0 with Java 17 (java.home=C:\Program Files\Eclipse Adoptium\jdk-17.0.1.12-hotspot) then this exception occurs:

java.lang.ArrayIndexOutOfBoundsException: Index -1 out of bounds for length 1
        at jogamp.opengl.windows.wgl.awt.WindowsAWTWGLGraphicsConfigurationFactory.chooseGraphicsConfigurationImpl(WindowsAWTWGLGraphicsConfigurationFactory.java:171)
        at com.jogamp.nativewindow.GraphicsConfigurationFactory.chooseGraphicsConfiguration(GraphicsConfigurationFactory.java:424)
        at com.jogamp.opengl.awt.GLCanvas.chooseGraphicsConfiguration(GLCanvas.java:1513)
        at com.jogamp.opengl.awt.GLCanvas.addNotify(GLCanvas.java:609)
        at java.desktop/java.awt.Container.addImpl(Container.java:1150)
        at java.desktop/java.awt.Container.add(Container.java:1001)
        at net.tourbook.map3.view.Map3View.createUI(Map3View.java:1069)
        at net.tourbook.map3.view.Map3View.createPartControl(Map3View.java:943)
        at org.eclipse.ui.internal.e4.compatibility.CompatibilityPart.createPartControl(CompatibilityPart.java:158)
        at org.eclipse.ui.internal.e4.compatibility.CompatibilityView.createPartControl(CompatibilityView.java:155)
        at org.eclipse.ui.internal.e4.compatibility.CompatibilityPart.create(CompatibilityPart.java:365)
       
       
The app is running OK with java.home=C:\Program Files\Eclipse Adoptium\jdk-11.0.13.8-hotspot
       
       
       
jogl jar from worldwind
       
Manifest-Version: 1.0
Ant-Version: Apache Ant 1.10.5
Created-By: 11.0.9+11-post-Debian-1deb10u1 (Debian)
Application-Name: Java Bindings for OpenGL
Specification-Title: Java Bindings for OpenGL API Specification
Specification-Version: 2.4
Specification-Vendor: JogAmp Community
Implementation-Title: Java Bindings for OpenGL Runtime Environment
Implementation-Version: 2.4.0-rc-20210111
Implementation-Build: 2.4-b1507-20210111
Implementation-Branch: origin/master
Implementation-Commit: ecf6e499d3b582d651a28693c871ca14d6e8c991
Implementation-Vendor: JogAmp Community
Implementation-URL: http://jogamp.org/
Extension-Name: com.jogamp.opengl
Implementation-Vendor-Id: com.jogamp
Trusted-Library: true
Permissions: all-permissions
Application-Library-Allowable-Codebase: *
Codebase: *.jogamp.org

       
Reply | Threaded
Open this post in threaded view
|

Re: jogl 2.4 and Java 17: Index -1 out of bounds for length 1

Martin
Hi,

You should be able to avoid this problem by adding these VM options at startup

--add-exports java.base/java.lang=ALL-UNNAMED
--add-exports java.desktop/sun.awt=ALL-UNNAMED
--add-exports java.desktop/sun.java2d=ALL-UNNAMED

This was originally discussed here.
Reply | Threaded
Open this post in threaded view
|

Re: jogl 2.4 and Java 17: Index -1 out of bounds for length 1

wolfgang-ch
This fixed the issue, THANKS