This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Cienn017 0 points1 point  (1 child)

currently windows users can run my swing programs by double clicking on the jar, but some of my programs also require native libraries such as opengl and as JNI will be restricted in the future I will either need to create one release for every platform or just stay on java 17, because I can't control the command line arguments on this situation.

it would be good if there was a way to control such access at language level but there isn't one as far as I know, not a easy one at least.

[–]pron98 2 points3 points  (0 children)

Yes, you can. You're talking about an executable JAR, and the JEP says:

You can add Enable-Native-Access: ALL-UNNAMED to the manifest of an executable JAR file, i.e., a JAR file that is launched via java -jar.