Login  Register

Re: Java17 compatibility error ??

Posted by gouessej on Oct 05, 2024; 1:18pm
URL: https://forum.jogamp.org/Java17-compatibility-error-tp4043006p4043545.html

You're welcome, thank you for your detailed information.

At first, the extension mechanism has been removed from Java a long time ago and your version of Java doesn't support it, -p is a shortcut of --module-path and JogAmp's Java has never been an extension and shouldn't be mixed with an old version of Java3D installed as an extension. It will probably not be enough to solve your problem but you shouldn't use "-p /Library/Java/Extensions".

Secondly, your version of Java uses UTF-8 by default on all operating systems, "-Dfile.encoding=UTF-8 -Dstdout.encoding=UTF-8 -Dstderr.encoding=UTF-8" is useless too in this case.

Thirdly, either avoid spaces in directory names or escape them correctly, i.e "3D Stuff" and "Miscellaneous JARS". Yes you have to add " marks around the classpath because of these spaces. Maybe Eclipse doesn't do that correctly.

Fourthly, you can simplify your classpath by using jogamp-all.jar instead of separate JogAmp JARs.

Moreover, there is no need to put bin/ into the classpath, don't confuse the classpath with the library path. If you don't want to change too much things, remove the spaces from your directory names, update your Eclipse run configuration to take this change into account, try again with --add-opens and if it still fails to work, try to remove the useless stuff I mentioned.

This should work:
/Library/Java/JavaVirtualMachines/jdk-23.jdk/Contents/Home/bin/java ‐‐add-opens=java.desktop/sun.awt=ALL-UNNAMED  -classpath /Users/andrew/Documents/eclipse-workspace/3D\ Stuff/bin:/Users/andrew/Miscellaneous\ JARS/vrml97.jar:/Users/andrew/Documents/eclipse-workspace/JOGL/bin:/Users/andrew/Documents/eclipse-workspace/JOGL/lib/gluegen-rt.jar:/Users/andrew/Documents/eclipse-workspace/JOGL/lib/gluegen-rt-natives-macosx-universal.jar:/Users/andrew/Documents/eclipse-workspace/JOGL/lib/jogl-all.jar:/Users/andrew/Documents/eclipse-workspace/JOGL/lib/jogl-all-natives-macosx-universal.jar:/Users/andrew/Documents/eclipse-workspace/Java3D/bin:/Users/andrew/Documents/eclipse-workspace/Java3D/lib/java3d-core.jar:/Users/andrew/Documents/eclipse-workspace/Java3D/lib/java3d-utils.jar:/Users/andrew/Documents/eclipse-workspace/Java3D/lib/vecmath.jar Demo.LightingExample
Julien Gouesse | Personal blog | Website