jzy3d / jogl

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

Unable to determine GraphicsConfiguration : JOGL 2.4 on Java 17 & Windows 10 #4

Open jzy3d opened 2 years ago

jzy3d commented 2 years ago

Reproduce with Jzy3D SurfaceDemoAWT

The below exception does not happen on JDK 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 0x699871b8]], 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.ChartLauncher.openChart(ChartLauncher.java:40)
    at org.jzy3d.chart.ChartLauncher.openChart(ChartLauncher.java:32)
    at org.jzy3d.chart.ChartLauncher.openChart(ChartLauncher.java:27)
    at org.jzy3d.analysis.AnalysisLauncher.open(AnalysisLauncher.java:23)
    at org.jzy3d.analysis.AnalysisLauncher.open(AnalysisLauncher.java:12)
    at org.jzy3d.demos.surface.SurfaceDemoAWT.main(SurfaceDemoAWT.java:30)

See also

jzy3d commented 2 years ago

As mentioned in the JOGL bugzilla ticket, 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

jzy3d commented 2 years ago

Relates to https://github.com/jzy3d/jogl/issues/12

Dude-Guy-Man commented 2 years ago

How would I fix this in Eclipse?

jzy3d commented 2 years ago

Apply the above mentioned JVM flags in the VM arguments of the Run Configuration of your program.

Dude-Guy-Man commented 2 years ago

Thanks a bunch!

ethan-colin commented 2 years ago

Thank you very much, it worked!

PhilipModDev commented 1 year ago

How do you run the command?

ethan-colin commented 1 year ago

How do you run the command?

  1. In Eclipse do as follows: Run -> Run Configurations -> Arguments
  2. Then write as follows in the text field under VM arguments:

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

  1. Apply and that's it.
PhilipModDev commented 1 year ago

Okay thanks

bszandras commented 1 year ago

Can someone help me how to fix this in VSCode? I put the above arguments in the launch.json args and it does not fix the issue.

revkelo commented 8 months ago

I LOVE YOU

KinManZHR commented 7 months ago

I have finished. but when I convert jar to exe, I don't know where to add this command. And error are here: Executing: D:\Desktop\inni\see.exe Exception in thread "AWT-EventQueue-0" com.jogamp.opengl.GLException: Unable to determine GraphicsConfiguration: WindowsWGLGraphicsConfiguration[DefaultGraphicsScreen[WindowsGraphicsDevice[type .windows, connection decon, unitID 0, handle 0x0, owner false, NullToolkitLock[obj 0x46541013]], idx 0], pfdID 9, ARB-Choosen true, requested GLCaps[rgba 8/8/8/0, opaque, accum-rgba 0/0/0/0, dp/st/ms 16/0/0, dbl, mono , hw, GLProfile[GL4/GL4.hw], on-scr[.]], chosen GLCaps[wgl vid 9 arb: rgba 8/8/8/0, opaque, accum-rgba 16/16/16/16, dp/st/ms 24/0/0, dbl, mono , hw, GLProfile[GL4/GL4.hw], on-scr[.]]]

MichaelMrt commented 6 months ago

Can someone help me how to fix this in VSCode? I put the above arguments in the launch.json args and it does not fix the issue.

I added the VM arguments to my launch.json and it fixed the issue. Here is my launch.json Keep in mind that you need to start the project through the launch.json and not run the your java file.

{ "version": "0.2.0", "configurations": [ { "type": "java", "name": "Launch Current File", "request": "launch", "mainClass": "${file}", "vmArgs": "--add-exports java.base/java.lang=ALL-UNNAMED --add-exports java.desktop/sun.awt=ALL-UNNAMED -- add-exports java.desktop/sun.java2d=ALL-UNNAMED", "projectName": "${workspaceFolderBasename}" }, { "type": "java", "name": "Debug (Launch) - App", "request": "launch", "mainClass": "Main.java", // Your main class "vmArgs": "--add-exports java.base/java.lang=ALL-UNNAMED --add-exports java.desktop/sun.awt=ALL-UNNAMED --add-exports java.desktop/sun.java2d=ALL-UNNAMED", "projectName": "${workspaceFolderBasename}" } ] }

FajarMerahDiwangkara commented 2 months ago

As mentioned in the JOGL bugzilla ticket, 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

Solution does not work in Java SE 17 Jdk 17 Windows 10 Eclipse IDE. Tried changing java se version to any version from 9 to 17, still does not work. Changing add-exports to add-opens does not work either, and adding both add-exports and add-opens also does not work. I gave up trying to fix this problem, i guess i need to look for alternative solution to opengl programming for my study assignment.