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

[Native] ArrayIndexOutOfBoundsException while selecting GL capabilities on Windows #159

Closed
jzy3d opened this issue Apr 9, 2021 · 4 comments
Milestone

Comments

@jzy3d
Copy link
Owner

jzy3d commented Apr 9, 2021

From this forum discussion

Jaime encounters the following stack trace when running the default ScatterDemoAWT in tutorials,

Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: Index -1 out of bounds for length 1
        at jogamp.opengl.windows.wgl.awt.WindowsAWTWGLGraphicsConfigurationFactory.chooseGraphicsConfigurationImpl(WindowsAWTWGLGraphicsConfigurationFactory.java:171)
        at com.jogamp.nativewindow.GraphicsConfigurationFactory.chooseGraphicsConfiguration(GraphicsConfigurationFactory.java:424)  
        at com.jogamp.opengl.awt.GLCanvas.chooseGraphicsConfiguration(GLCanvas.java:1560)
        at com.jogamp.opengl.awt.GLCanvas.addNotify(GLCanvas.java:611)
        at java.desktop/java.awt.Container.addNotify(Container.java:2801)
        at java.desktop/java.awt.Window.addNotify(Window.java:787)
        at java.desktop/java.awt.Frame.addNotify(Frame.java:493)
        at java.desktop/java.awt.Window.pack(Window.java:825)
        at org.jzy3d.bridge.awt.FrameAWT.initialize(FrameAWT.java:42)
        at org.jzy3d.bridge.awt.FrameAWT.<init>(FrameAWT.java:23)
        at org.jzy3d.chart.factories.AWTPainterFactory.newFrame(AWTPainterFactory.java:103)
        at org.jzy3d.chart.Chart.open(Chart.java:263)
        at org.jzy3d.chart.ChartLauncher.openChart(ChartLauncher.java:41)
        at org.jzy3d.chart.ChartLauncher.openChart(ChartLauncher.java:33)
        at org.jzy3d.chart.ChartLauncher.openChart(ChartLauncher.java:28)
        at org.jzy3d.analysis.AnalysisLauncher.open(AnalysisLauncher.java:23)
        at org.jzy3d.analysis.AnalysisLauncher.open(AnalysisLauncher.java:12)
        at com.jaime.App.main(App.java:16)

Hardware (CPU, GPU)
Intel(R) Core(TM) i7-8550U CPU
Intel(R) UHD Graphics 620
Versão do driver: 27.20.100.8681
Data do driver: 05/09/2020
Versão do DirectX: 12 (FL 12.1)
Local físico: Barramento PCI 0, dispositivo 2, função 0

OS type and version
Edição Windows 10 Home Single Language
Versão 20H2
Instalado em ‎15/‎12/‎2020
Compilação do SO 19042.868
Experiência Windows Feature Experience Pack 120.2212.1070.0

JDK version
openjdk version "11.0.10" 2021-01-19
OpenJDK Runtime Environment AdoptOpenJDK (build 11.0.10+9)
OpenJDK 64-Bit Server VM AdoptOpenJDK (build 11.0.10+9, mixed mode)
jdk-16

Software
Jzy3d 2.0, JOGL 2.3.2

@jzy3d
Copy link
Owner Author

jzy3d commented Apr 19, 2021

You may use EmulGL instead of JOGL for rendering with Jzy3D. EmulGL is made to enhance charts portability across computers.

See links to examples in the readme.

@jzy3d jzy3d changed the title ArrayIndexOutOfBoundsException while selecting GL capabilities on Windows [Native] ArrayIndexOutOfBoundsException while selecting GL capabilities on Windows Apr 19, 2021
@jzy3d jzy3d added this to the 2.0.1 milestone Jun 6, 2021
@jzy3d
Copy link
Owner Author

jzy3d commented Nov 5, 2021

I encountered the same on Windows when using the JDK provided by Eclipse, which is a JDK 17. I ran the project with JDK 8 instead of the default one, then the program can execute.

@jzy3d
Copy link
Owner Author

jzy3d commented Nov 8, 2021

@jzy3d
Copy link
Owner Author

jzy3d commented Feb 28, 2022

This can be fixed by using the following 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant