Open jzy3d opened 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
Relates to https://github.com/jzy3d/jogl/issues/12
How would I fix this in Eclipse?
Apply the above mentioned JVM flags in the VM arguments of the Run Configuration of your program.
Thanks a bunch!
Thank you very much, it worked!
How do you run the command?
How do you run the command?
--add-exports java.base/java.lang=ALL-UNNAMED --add-exports java.desktop/sun.awt=ALL-UNNAMED --add-exports java.desktop/sun.java2d=ALL-UNNAMED
Okay thanks
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 LOVE YOU
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[.]]]
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}" } ] }
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.
Reproduce with Jzy3D SurfaceDemoAWT
The below exception does not happen on JDK 11
See also