Login  Register

Re: JOGL Java 10 modularization

Posted by kaisevoj on Jul 10, 2018; 8:34pm
URL: https://forum.jogamp.org/JOGL-Java-10-modularization-tp4038983p4039000.html

Hi,

I played a bit with the project, and found out no errors are produced if I use

<dependency>
        <groupId>org.jogamp.gluegen</groupId>
        <artifactId>gluegen-rt</artifactId>
        <version>2.3.2</version>
</dependency>
<dependency>
        <groupId>org.jogamp.jogl</groupId>
        <artifactId>jogl-all</artifactId>
        <version>2.3.2</version>
</dependency>

instead of main alternatives (supplying natives through deprecated dll's) with module-info

module com.test {
        requires gluegen.rt;
        requires jogl.all;
        requires java.desktop;
        exports com.test;
}

but I arrived at a runtime error

Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: -1
        at jogl.all@2.3.2/jogamp.opengl.windows.wgl.awt.WindowsAWTWGLGraphicsConfigurationFactory.chooseGraphicsConfigurationImpl(WindowsAWTWGLGraphicsConfigurationFactory.java:171)
        at jogl.all@2.3.2/com.jogamp.nativewindow.GraphicsConfigurationFactory.chooseGraphicsConfiguration(GraphicsConfigurationFactory.java:424)
        at jogl.all@2.3.2/com.jogamp.opengl.awt.GLCanvas.chooseGraphicsConfiguration(GLCanvas.java:1560)
        at jogl.all@2.3.2/com.jogamp.opengl.awt.GLCanvas.addNotify(GLCanvas.java:611)
        at java.desktop/java.awt.Container.addNotify(Container.java:2798)
        at java.desktop/java.awt.Window.addNotify(Window.java:786)
        at java.desktop/java.awt.Frame.addNotify(Frame.java:490)
        at java.desktop/java.awt.Window.show(Window.java:1048)
        at java.desktop/java.awt.Component.show(Component.java:1674)
        at java.desktop/java.awt.Component.setVisible(Component.java:1621)
        at java.desktop/java.awt.Window.setVisible(Window.java:1031)
        at com.test/com.test.Main.main(Main.java:47)

Was not able to google much about it (except it is know by some to be java 9 related JOGL issue, advising not to use java 9 - helpful).

I created repo (https://github.com/kaisevoj/jogl-test) with minimal sample code that produces exception above with module-info.java present, but runs fine without it - that makes me believe this is bound to be issue connected to modularization.

Best regards,
Vojtěch