Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

running under Java 11 gives "illegal reflective access" warnings #18

Closed
dsudar opened this issue Apr 2, 2020 · 4 comments
Closed

running under Java 11 gives "illegal reflective access" warnings #18

dsudar opened this issue Apr 2, 2020 · 4 comments

Comments

@dsudar
Copy link

dsudar commented Apr 2, 2020

When raw2ometiff runs under Java 11, it gives warnings about illegal reflective access in the org.janelia.saalfeldlab.n5.CompressionAdapter library:

WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.janelia.saalfeldlab.n5.CompressionAdapter (file:/usr/local/raw2ometiff-0.1.1-SNAPSHOT/lib/n5-2.1.3.jar) to field java.lang.reflect.Field.modifiers
WARNING: Please consider reporting this to the maintainers of org.janelia.saalfeldlab.n5.CompressionAdapter
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release

No such problems when running under Java 8.

@melissalinkert
Copy link
Member

#15 was merged a few days ago and should have solved this problem. Do you still see a problem when building and running from the latest master commit?

@dsudar
Copy link
Author

dsudar commented Apr 3, 2020

I just build a new set of bioformats2raw and raw2ometiff from whatever is committed to github. And was just able to test it. Definitely something changed but not yet for the better:

WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.janelia.saalfeldlab.n5.ReflectionUtils (file:/usr/local/raw2ometiff-0.1.1/lib/n5-2.1.6.jar) to field java.lang.reflect.Field.modifiers
WARNING: Please consider reporting this to the maintainers of org.janelia.saalfeldlab.n5.ReflectionUtils
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release

@melissalinkert
Copy link
Member

@chris-allan
Copy link
Member

These warnings are safe to ignore, specific mitigation is already in place with N5 2.1.6 for Java 13. On Java 11+ you can avoid these warnings by explicitly declaring that java.lang.reflect deep reflection be allowed by using --add-opens [1] to your JAVA_OPTS before running raw2ometiff:

  • JAVA_OPTS="--add-opens=java.base/java.lang.reflect=ALL-UNNAMED"
  1. https://docs.oracle.com/javase/9/migrate/toc.htm#JSMIG-GUID-7BB28E4D-99B3-4078-BDC4-FC24180CE82B

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants