I found following solution (workaround) - add 3 JVM parameters:
I tried this and it worked just fine when I launched my application from Eclipse IDE (in Debug mode). When running it from IDE, there is no exception and everything seems to be working as expected. But when I run it from build - runtime application, exception is still there, no matter if I pass those parameters to it or not.
I tried to print all VM arguments from eclipse:
[-agentlib:jdwp=transport=dt_socket,suspend=y,address=localhost:59220, -Dosgi.requiredJavaVersion=17, -Xms256m, -Xmx4g, -Djava.library.path=C:\lite3d_repos\zdrojaky_linux-afterconfig\litebox3d\win_b64\code\bin;C:\lite3d_repos\zdrojaky_linux-afterconfig\litebox3d\win_b64\code\bin\plugins;C:\lite3d_repos\zdrojaky_linux-afterconfig\litebox3d\java, -DTCA_PROJECT_VARRAY=1, -DTCA_PROJECT_SUFFIX=, -DTCA_PROJECT_DEBUG=, -DTCA_DRY_RUN=, -Dsun.java2d.noddraw=true, -Dsun.java2d.uiScale=1, --add-exports=java.base/java.lang=ALL-UNNAMED, --add-exports=java.desktop/sun.awt=ALL-UNNAMED, --add-exports=java.desktop/sun.java2d=ALL-UNNAMED, --add-modules=ALL-SYSTEM, -Dfile.encoding=Cp1250].
And I also tried to print all VM arguments from runtime build:
[-Xms40m, -Xmx4g, -DTCA_PROJECT_VARRAY=1, -DTCA_PROJECT_SUFFIX=, -Dsun.java2d.noddraw=true, -Dsun.java2d.uiScale=1, --add-exports java.base/java.lang=ALL-UNNAMED, --add-exports java.desktop/sun.awt=ALL-UNNAMED, --add-exports java.desktop/sun.java2d=ALL-UNNAMED].
We build our application using SCons but not sure, if that is important. On Java 11, everything is fine. Java 17 update is necesarry for us because of the other tool, where we integrate our solution.
Does anyone have any idea, why it behaves like this? Are there any differences for JOGL libs when they are run from debug and from release? Are there any other workarounds for this?
I guess this might be more question for Eclipse RCP forum and I am planning to share it there as well but in case you have any idea how to overcome this, it would be very appreciated. I can provide more information if requested.
I suspect the problem has nothing to do with JOGL. There are two possible root causes:
- Shouldn't you use --add-opens?
- There are two syntaxes but in some cases, only one of them works:
I advise you to reproduce your problem on a tiny example if it persists.