Hi Anjan, Do you see a stacktrace if you set the illegal-access flag to debug or deny? E.g. if using Maven:
export MAVEN_OPTS="--illegal-access=debug" This is expected behavior if you are calling the size property (since that's a private field) on a list. Older versions of Groovy might mistakenly call that. If we can narrow down what is calling that, we can tell you if a later version of Groovy fixes it. If it is in your code, then it is behaving as expected. Failing that, do you have a reproducer? In general, if you want to stick to JDK11, you might need to use --add-opens. Cheers, Paul. On Fri, Feb 20, 2026 at 4:47 PM Anjan Baradwaj via users <[email protected]> wrote: > > Hello Groovy Team, > > We are using Groovy 3.0.12 with JDK 11 and see the following warning > WARNING: An illegal reflective access operation has occurred > WARNING: Illegal reflective access by org.codehaus.groovy.vmplugin.v9.Java9 > (file: .../groovy-3.0.12.jar) to field java.util.ArrayList.size > WARNING: Please consider reporting this to the maintainers of > org.codehaus.groovy.vmplugin.v9.Java9 > WARNING: All illegal access operations will be denied in a future release > > We also tested with Groovy 4.x and observed similar behavior. > > Environment details: > > Groovy: 3.0.12 (also tested 4.x) > Java: 11.0.29 > Maven: 3.5.2 > > Could you please let us know: > > Has this been fixed in any newer Groovy 3.x or 4.x version? > If yes, which version should we upgrade to? > Is there any recommended approach to avoid this without using --add-opens JVM > options? > > > Thank you for your help. > > Best regards, > Anjan > > CONFIDENTIALITY NOTICE: The information contained in this electronic message > is intended to be viewed only by the individual or entity to which it is > addressed. It may contain information that is privileged, confidential, and > exempt from disclosure under applicable law. If the reader of this message is > not the intended recipient, you are hereby notified that any dissemination, > distribution or duplication of this message is strictly prohibited. If this > electronic message has been received in error, please notify sender > immediately by return email and delete the original message and any copies of > it from your computer system. Thank you.
