Reputation: 5220
Currently i am running into this issue
WARNING: Illegal reflective access by my-example-class to field
sun.reflect.annotation.AnnotationInvocationHandler.memberValues
What I understand is that I need to add --add-opens module/package=target-module(,target-module)*
Knowing the full path to the field name, where can I search for the package name / module name so that I can pass to the -add-opens
flag?
Right now I can only guess --add-opens something/sun.reflect.annotation=ALL-UNNAMED
Upvotes: 2
Views: 1374
Reputation: 1116
To get a Module by a Class, you can use the getModule()
Module module = YourClass.getModule();
To get the name ->
String moduleName = module.getName();
Use this.getClass().getCanonicalName()
to get the full class name.
Resources:
Oracle documentation about getModule
How to use getCanonicalName method
Upvotes: 2