Replace Unsafe and illegal reflection operations
See original GitHub issueGave a quick try to lmdbjava with JDK 9 and wanted to record the findings here.
Due the the class access restrictions imposed by Jigsaw, the following JVM arguments have to be specified:
--add-opens java.base/java.nio=ALL-UNNAMED --add-opens java.base/sun.nio.ch=ALL-UNNAMED
Issue Analytics
- State:
- Created 7 years ago
- Reactions:5
- Comments:31 (17 by maintainers)
Top Results From Across the Web
A peek into Java 17: Encapsulating the Java runtime internals
What's changing in Java 17? In Java 16, it is still possible to restore the situation that existed previously by using the --illegal-access ......
Read more >An illegal reflective access operation has occurred when ...
The purpose of this article is to provide assistance if you encounter "An illegal reflective access operation has occurred" warning when ...
Read more >What is an illegal reflective access? - java - Stack Overflow
The first reflective-access operation to any such package causes a warning to be issued, but no warnings are issued after that point. This ......
Read more >Illegal access in Java 16 A.K.A. 'My program crashes!'
Please note it doesn't raise a warning about any “reflective access operation”, but “illegal reflective access operation”. Using reflection on ...
Read more >Java issue- WARNING: An illegal reflective access operation ...
The analysis process works as intended, but the errors are alarming to viewers. Using Azul Java 1.8.0_202 does not alarm to those deprecated ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Commit 5687bd61ff8de770800fa319b4b98a0f61a92b24 shows how to add the required JVM parameters for running tests in Maven builds etc. It’s implemented as a profile as we presently perform CI builds with Java 8.
https://openjdk.java.net/jeps/412 looks a promising pathway for Java 17 and above, particularly given Java 17 is LTS.
How would people feel about LmdbJava 1.x targeting Java 16 and below, with LmdbJava 2.x requiring Java 17 and above? This would draw a line in the sand and allow use of newer APIs.
I just wanted to ask if there is any progress on this issue. I’m using
--add-opens java.base/java.nio=ALL-UNNAMED --add-opens java.base/sun.nio.ch=ALL-UNNAMED
where possible, but in some cases I cannot do that and then the “illegal reflective access” warnings show up. BTW: Does anybody know how to get rid of the warnings without the commandline arguments?