jzy3d / jzy3d-api

A Java API for 3d and 2d charts
BSD 3-Clause "New" or "Revised" License
281 stars 145 forks source link

[Native] GLException: Unable to determine GraphicsConfiguration #208

Closed jzy3d closed 2 years ago

jzy3d commented 2 years ago

With JOGL 2.4, Windows 10, Eclipse-provided JDK (17). Works with Azul JDK 8, 11.

Exception in thread "main" com.jogamp.opengl.GLException: Unable to determine GraphicsConfiguration: WindowsWGLGraphicsConfiguration[DefaultGraphicsScreen[WindowsGraphicsDevice[type .windows, connection decon, unitID 0, handle 0x0, owner false, NullToolkitLock[obj 0x50832aa4]], idx 0], pfdID 7, ARB-Choosen true,
    requested GLCaps[rgba 8/8/8/8, opaque, accum-rgba 0/0/0/0, dp/st/ms 16/0/0, dbl, mono  , hw, GLProfile[GL2/GL4bc.hw], on-scr[.]],
    chosen    GLCaps[wgl vid 7 arb: rgba 8/8/8/8, opaque, accum-rgba 16/16/16/16, dp/st/ms 16/0/0, dbl, mono  , hw, GLProfile[GL2/GL4bc.hw], on-scr[.]]]
    at jogamp.opengl.windows.wgl.awt.WindowsAWTWGLGraphicsConfigurationFactory.chooseGraphicsConfigurationImpl(WindowsAWTWGLGraphicsConfigurationFactory.java:182)
    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.addNotify(Container.java:2804)
    at java.desktop/java.awt.Window.addNotify(Window.java:791)
    at java.desktop/java.awt.Frame.addNotify(Frame.java:495)
    at java.desktop/java.awt.Window.pack(Window.java:829)
    at org.jzy3d.bridge.awt.FrameAWT.initialize(FrameAWT.java:41)
    at org.jzy3d.bridge.awt.FrameAWT.<init>(FrameAWT.java:22)
    at org.jzy3d.chart.factories.AWTPainterFactory.newFrame(AWTPainterFactory.java:102)
    at org.jzy3d.chart.Chart.open(Chart.java:375)
    at org.jzy3d.chart.Chart.open(Chart.java:347)
jzy3d commented 2 years ago

Duplicates https://github.com/jzy3d/jzy3d-api/issues/230

jzy3d commented 2 years ago

Running the JVM with

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

fixes the problem

jonbarril commented 11 months ago

I too get the exception. Using your fix (adding exports) fixes the problem. Why? Is there any way not to have to included these VM args?

I'm trying to build an executable jar for use by others, who can double-click the jar file but will likely not be able to deal with use of VM args and such.