Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

An illegal reflective access operation has occurred #138

Closed
chkpnt opened this issue Nov 18, 2020 · 4 comments
Closed

An illegal reflective access operation has occurred #138

chkpnt opened this issue Nov 18, 2020 · 4 comments

Comments

@chkpnt
Copy link

chkpnt commented Nov 18, 2020

I'm getting the following warning when using remap with Java 11:

WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by net.sf.cglib.core.ReflectUtils$1 (file:/Users/ich/.gradle/caches/modules-2/files-2.1/cglib/cglib/3.2.9/a4b7af2ea0a5ecad2d283c2fff119009f0c60d20/cglib-3.2.9.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 net.sf.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

What is the recommended way to suppress this warning?

@schuettec
Copy link
Contributor

schuettec commented Nov 18, 2020 via email

@chkpnt
Copy link
Author

chkpnt commented Nov 18, 2020

Thanks for the quick response, which gave me the correct hint (towards the module system). Credits also to @nipafx, whose blog post gave me further insights.

At the moment I do not want to migrate to the JPMS , so I'm now using the --add-opens argument for the JVM, i.e. the following for Gradle:

application {
    applicationDefaultJvmArgs = ["--add-opens", "java.base/java.lang=ALL-UNNAMED"]
}

@chkpnt chkpnt closed this as completed Nov 18, 2020
@nipafx
Copy link

nipafx commented Nov 20, 2020

Glad to hear, the blog post helped, @chkpnt!

Huh, I didn't know Remondis had an IT branch - talk about garbage collection... 😂 Sorry for the silly pun, I couldn't resist.

@schuettec
Copy link
Contributor

Haha yes, default joke for new employees ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants