dorkbox / Utilities

Dorkbox General Utilities
Other
7 stars 3 forks source link

Illegal reflective access warning by dorkbox.util.Swt with Java 9 #2

Open apetrelli opened 6 years ago

apetrelli commented 6 years ago

When using the sister project "SystemTray" in my project [1] under Java 9 I see the following warning:

WARNING: An illegal reflective access operation has occurred WARNING: Illegal reflective access by dorkbox.util.Swt (file:/home/anpetrel/.m2/repository/com/dorkbox/SystemTray/3.11/SystemTray-3.11.jar) to method java.lang.ClassLoader.findLoadedClass(java.lang.String) WARNING: Please consider reporting this to the maintainers of dorkbox.util.Swt 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

[1] https://github.com/apetrelli/scafa/tree/j9

dorkbox commented 6 years ago

Thanks for reporting.

From my google-foo, a harmless and fairly common warning. I'll see what I can do to properly fix it sometime in the future (and before this behavior is denied) as I'm swamped with work right now.

Suggestions/pull requests are welcome!

apetrelli commented 6 years ago

Hello @dorkbox sorry but here I don't know where to start, except using --add-opens at runtime. If you have the time, try to explain what you are trying to do in this class in English. This is just to explain to me or any other people who want to get in the project to try to fix the problem.

dorkbox commented 6 years ago

Of course.

This class (dorkbox.util.Swt.java) is to provide reflection to access SWT methods, so SWT isn't a dependency for the SystemTray.