Illegal reflective access warning on Classpath.getClasspathURIs() with Adopt JDK 11
See original GitHub issueI use AdopJDK on Windows with the following version:
Eclipse OpenJ9 VM AdoptOpenJDK (build openj9-0.24.0, JRE 11 Windows 10 amd64-64-Bit Compressed References 20210120_899 (JIT enabled, AOT enabled)
OpenJ9 - 345e1b09e
OMR - 741e94ea8
JCL - 0a86953833 based on jdk-11.0.10+9)
With ClassGraph 4.8.135 I have a JEE application running in Open Liberty that does the following ClassGraph call:
List<URI> classpathEntries = new ClassGraph().getClasspathURIs();
With this I get the following warning from the JDK:
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by nonapi.io.github.classgraph.reflection.ReflectionDriver (file:/D:/Programme/openLiberty/openLiberty-SAMV/wlp/usr/servers/SAMV-Liberty/apps/expanded/Gradle___de_dsv_samv___SamvEAR_ear.ear/lib/classgraph-4.8.135.jar) to method com.ibm.java.lang.management.internal.RuntimeMXBeanImpl.getInputArguments()
WARNING: Please consider reporting this to the maintainers of nonapi.io.github.classgraph.reflection.ReflectionDriver
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
As the warning mentions that illegal reflective access might be denied in future releases of the JDK it would be interesting how to handle this situation.
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (2 by maintainers)
Top Results From Across the Web
Java 9 Illegal Reflective Access Warning - Baeldung
In this tutorial, we'll inspect the relationship between the module system and reflection. 2. Modular System and Reflection.
Read more >Issues - GitHub
on JDK 11 - WARNING: Illegal reflective access by org.springframework.cglib.core.ReflectUtils$1 (file:/C:/Users/.../spring-core/4.3.22.
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 >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 using ...
Read more >Illegal reflective access by BytecodeProviderImpl_...
WARNING: An illegal reflective access operation has occurred. WARNING: Illegal reflective access by com.atlassian.hibernate.adapter.proxy.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Your are right. Seems to be a problem with my environment. The correct version is selected from Gradle.
Great, thank you for confirming!
I have no idea where Gradle looks up the latest version. Is this a Gradle thing, or a Gradle IDE plugin thing?