问题:
JDK11.0.3 报错,11.0.2 还正常
Caused by: java.lang.reflect.InaccessibleObjectException: Unable to make field private jdk.internal.reflect.MethodAccessorImpl jdk.internal.reflect.DelegatingMethodAccessorImpl.delegate accessible: module java.base does not “opens jdk.internal.reflect” to unnamed module @4f757cf6
at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:340)
at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:280)
at java.base/java.lang.reflect.Field.checkCanSetAccessible(Field.java:176)
at java.base/java.lang.reflect.Field.setAccessible(Field.java:170)
解决:
增加 –add-opens java.base/jdk.internal.reflect=ALL-UNNAMED
参考:
https://www.e-learn.cn/content/wangluowenzhang/393259