DmitryKey / luke

This is mavenised Luke: Lucene Toolbox Project
Apache License 2.0
1.54k stars 352 forks source link

"An illegal reflective access operation" warning on JDK9+ #125

Closed mocobeta closed 5 years ago

mocobeta commented 6 years ago

When running on JDK9+, some warnings are observed (JDK emits those to stdout, so we cannot ignore it.)

WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.google.inject.internal.cglib.core.$ReflectUtils$1 (file:/Users/tomoko.uchida/opt/luke/luke-swing-7.5.0/target/luke-swing-with-deps.jar) to method java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain)
WARNING: Please consider reporting this to the maintainers of com.google.inject.internal.cglib.core.$ReflectUtils$1
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

(Luke highly relies on Guice to tie model classes to UI components.)

Google Guice team is working to resolve it. https://github.com/google/guice/issues/1133 https://github.com/google/guice/issues/1205

We should keep watching and upgrade Guice version when the problem is settled.

mocobeta commented 5 years ago

JVM option --add-opens java.base/java.lang=ALL-UNNAMED is needed to allow deep reflection on JDK9+.