Login  Register

Re: Illegal reflective access with jogamp-java3d1.7.0-final

Posted by gouessej on Apr 02, 2023; 10:58am
URL: https://forum.jogamp.org/Illegal-reflective-access-with-jogamp-java3d1-7-0-final-tp4042358p4042376.html

--add-opens has existed since Java 9:
https://docs.oracle.com/javase/9/migrate/toc.htm

Which documentation are you talking about? The man(ual) mentions the module path in Java 11 but it might not mention some options related to Jigsaw. Java3D can work with Java 11.

Bundling a JRE with a Java program is possible and not very difficult, time has changed, most systems don't have Java installed anyway, relying on the JRE installed on the system isn't a very good idea nowadays, most end users don't even know what a JRE is. If you really want to take care of your audience, don't give it a simple JAR, don't require a JRE installed on the system, use the technical solution that allows your end users to run your software very easily. For example, Eclipse Theia is packaged as an AppImage, Gephi is packaged as a kind of executable for some platforms, you can even create a DEB and/or RPM package.
You can use various tool to do that, including jpackage with jlink, PackR (not actively maintained?) or some other tools including mine. Please note that this solution would help your end users not to have to deal with the JRE by themselves.

Avoiding using reflection in Java3D isn't doable but on the long term, some efforts can be done to improve the modularization of the APIs managed by the JogAmp community to get rid of the nasty warnings cleanly and with correctness, without introducing dirty kludges.

To be honest, yes there are security considerations, we need to benefit of some fixes too. Supporting pre-Java 9 and post-Java 9 JREs at the same time is at least challenging or even nearly impossible in some cases, totally impossible without reflection. I don't encourage maintainers to support Java 8, it requires too much work, we're a small community. Some internal classes have been moved or removed in Java, the behavior of AWT and Swing has subtly changed in some areas including HiDPI. Trying to make Java3D 1.7 work with obsolete versions of Java is the dead end.

I know that my suggestion requires some work on your side but it will require less effort for your end users, isn't it what you want?

By the way, I plan to support AppImage in JNDT in the next months. If you succeed in creating a single fat JAR, it will be a suitable input for the solutions I mentioned earlier.
Julien Gouesse | Personal blog | Website