question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Replace Unsafe and illegal reflection operations

See original GitHub issue

Gave 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:open
  • Created 7 years ago
  • Reactions:5
  • Comments:31 (17 by maintainers)

github_iconTop GitHub Comments

7reactions
benalexaucommented, Aug 17, 2021

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.

7reactions
jubaxcommented, Jun 27, 2019

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?

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found