Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
jzy3d opened this issue Nov 9, 2021 · 14 comments
Labels
bug Something isn't working Windows

Comments

@jzy3d
Copy link
Owner

jzy3d commented Nov 9, 2021

Reproduce with Jzy3D SurfaceDemoAWT

  • JOGL 2.4
  • JZY3D 2.0.1
  • Java 17, JDK 8
  • WIN 10

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 jzy3d added the bug Something isn't working label Nov 9, 2021
@jzy3d jzy3d changed the title JOGL 2.4 on Java 17 & Windows 10 : Unable to determine GraphicsConfiguration Unable to determine GraphicsConfiguration : JOGL 2.4 on Java 17 & Windows 10 Dec 2, 2021
@jzy3d jzy3d added the Windows label Dec 8, 2021
@jzy3d
Copy link
Owner Author

jzy3d commented Jan 4, 2022

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
Copy link
Owner Author

jzy3d commented Jan 5, 2022

Relates to #12

@Dude-Guy-Man
Copy link

How would I fix this in Eclipse?

@jzy3d
Copy link
Owner Author

jzy3d commented Feb 9, 2022

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

@Dude-Guy-Man
Copy link

Thanks a bunch!

@ethan-colin
Copy link

Thank you very much, it worked!

@PhilipModDev
Copy link

How do you run the command?

@ethan-colin
Copy link

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
Copy link

Okay thanks

@bszandras
Copy link

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
Copy link

revkelo commented Nov 29, 2023

I LOVE YOU

@KinManZHR
Copy link

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
Copy link

MichaelMrt commented Jan 28, 2024

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
Copy link

FajarMerahDiwangkara commented Jun 12, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Windows
Projects
None yet
Development

No branches or pull requests

9 participants