> Hi, > > It's long overdue, but the status quo is not really nice. Running Groovy > on Java 9+ gives warnings like this: > > WARNING: An illegal reflective access operation has occurred > WARNING: Illegal reflective access by > org.codehaus.groovy.vmplugin.v7.Java7$1 > (file:/tmp/groovy-2.5.3/target/groovy-2.5.3/lib/groovy-2.5.3.jar) to > constructor java.lang.invoke.MethodHandles$Lookup(java.lang.Class,int) > WARNING: Please consider reporting this to the maintainers of > org.codehaus.groovy.vmplugin.v7.Java7$1 >
I am curious if the approach utilising sun.misc.Unsafe discussed in this stack overflow thread has been considered? https://stackoverflow.com/questions/46454995/how-to-hide-warning-illegal-reflective-access-in-java-9-without-jvm-argument It's definitely a hack and may not work on all JVMs or in the future. Nonetheless, I still consider it superior to having these warnings emitted, and it fairly cleanly just turns off logging of these messages. The main downside is it turns them off globally so non-groovy related warnings and maybe other messages of interest from the same logger would also not be emitted. Cheers, Simon