jzy3d / jogl

Mirror of https://jogamp.org/cgit/jogl.git/
Other
6 stars 2 forks source link

Unable to determine graphics configuration on Windows / ArrayIndexOutOfBoundsException: Index -1 out of bounds for length 1 #12

Open jzy3d opened 2 years ago

jzy3d commented 2 years ago

With JOGL 2.3.2, JOGL 2.4

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)

Discussed on JOGL forum on JOGL bugtracker on Jzy3D forum

jzy3d commented 2 years ago

As discussed on JOGL bugtracker, it can be workaround using the following VM options

--add-exports java.base/java.lang=ALL-UNNAMED
--add-exports java.desktop/sun.awt=ALL-UNNAMED
--add-exports java.desktop/sun.java2d=ALL-UNNAMED
jzy3d commented 2 years ago

What is surprising is that the 2.4 rc are supposed to contain a fix commited on June 2020 which exactly address this problem.

Indeed, this bug is exactly the same that the one that led to the fix. This may mean (?) that the 2.4 build contains outdated jars.