question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Illegal reflective access warning on Classpath.getClasspathURIs() with Adopt JDK 11

See original GitHub issue

I 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:closed
  • Created 2 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
UlrichLohrmanncommented, Nov 29, 2021

Your are right. Seems to be a problem with my environment. The correct version is selected from Gradle.

0reactions
lukehutchcommented, Nov 29, 2021

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?

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found