Re: Jogl / Java3D with Java 11 ?
Posted by DonPearson on Aug 04, 2019; 4:24pm
URL: https://forum.jogamp.org/Jogl-Java3D-with-Java-11-tp4039896p4039903.html
Good question actually! There is no release number on it. The directory has an 2015-10-09 timestamp on it, and I downloaded it last July (2018). I tried to find a version number but could not.
Here is some more info on work I did yesterday: I can get my application to work with JogAmp in Netbeans11 using JDK1.8. Looking at the classpath for that project, I have jogamp-fat.jar and j3dcore,j3dutils, and vecmath.jar listed. All works. I then recreated a separate project to use JDK11. My own application code now exists in modules (no actual source code changes) and I use that in my new project. To get that JDK11 project to be able to compile, I moved the 4 jar files above from the classpath to the module path, and my module-info file now shows them as required (i.e. automatic modules?). The application then succesfully builds (although jLink apparently doesn't work with automatic modules). When I go to run, I get the following error:
StarChart3Dpanel constructor scene has been created
StarChart3Dpanel constructor : create simple Universe
java.lang.ArrayIndexOutOfBoundsException: Index -1 out of bounds for length 1
at jogamp.fat/jogamp.opengl.windows.wgl.awt.WindowsAWTWGLGraphicsConfigurationFactory.chooseGraphicsConfigurationImpl(WindowsAWTWGLGraphicsConfigurationFactory.java:171)
at jogamp.fat/com.jogamp.nativewindow.GraphicsConfigurationFactory.chooseGraphicsConfiguration(GraphicsConfigurationFactory.java:424)
at j3dcore/javax.media.j3d.JoglPipeline.createAwtGraphicsConfiguration(JoglPipeline.java:8643)
at j3dcore/javax.media.j3d.JoglPipeline.getBestConfiguration(JoglPipeline.java:8375)
at j3dcore/javax.media.j3d.Renderer.doWork(Renderer.java:496)
at j3dcore/javax.media.j3d.J3dThread.run(J3dThread.java:271)
DefaultRenderingErrorListener.errorOccurred:
GRAPHICS_CONFIG_ERROR: Renderer: Error in GraphicsConfigTemplate3D.getBestConfiguration()
graphicsDevice = D3DGraphicsDevice[screen=0]
Exception in thread "main" java.lang.NullPointerException: Canvas3D: null GraphicsConfiguration
at j3dcore/javax.media.j3d.Canvas3D.checkForValidGraphicsConfig(Canvas3D.java:943)
at j3dcore/javax.media.j3d.Canvas3D.<init>(Canvas3D.java:986)
at j3dutils/com.sun.j3d.utils.universe.Viewer.<init>(Viewer.java:205)
at j3dutils/com.sun.j3d.utils.universe.Viewer.<init>(Viewer.java:151)
at j3dutils/com.sun.j3d.utils.universe.SimpleUniverse.<init>(SimpleUniverse.java:249)
at j3dutils/com.sun.j3d.utils.universe.SimpleUniverse.<init>(SimpleUniverse.java:211)
at j3dutils/com.sun.j3d.utils.universe.SimpleUniverse.<init>(SimpleUniverse.java:96)
at StarChart3D/starChart3D.StarChart3Dpanel.<init>(StarChart3Dpanel.java:78)
at StarChart3D/starChart3D.StarChart3DmainFrame.<init>(StarChart3DmainFrame.java:64)
at StarChart3D/starChart3D.StarChart3Dapp.<init>(StarChart3Dapp.java:26)
at StarChart3D/starChart3D.StarChart3Dapp.main(StarChart3Dapp.java:53)
C:\Users\Don\AppData\Local\NetBeans\Cache\11.0\executor-snippets\run.xml:111: The following error occurred while executing this line:
C:\Users\Don\AppData\Local\NetBeans\Cache\11.0\executor-snippets\run.xml:40: Java returned: 1
BUILD FAILED (total time: 15 seconds)
Note: here is the code snippet around the error:
System.out.println("StarChart3Dpanel constructor : create simple Universe");
SimpleUniverse su = new SimpleUniverse();
System.out.println("StarChart3Dpanel constructor : simple Universe created");
To me, it is interesting that it the same identical application code around the same jar file, but gets different results. So I need to first figure out what is going on here before worrying about the jLink distribution part. Any help you can provide would be appreciated. You were extremely helpful to me a year ago just stepping up to JogAmp.