mardi 17 août 2021

Java Error with Java16 : java.lang.reflect.InaccessibleObjectException

Existing code is working perfectly fine with JDK11 installed. Same lines of code is throwing below error in JDK16

java.lang.reflect.InaccessibleObjectException: Unable to make private static native long[] java.util.prefs.WindowsPreferences.WindowsRegOpenKey(long,byte[],int) accessible: module java.prefs does not "opens java.util.prefs" to unnamed module @3f803fae
    at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:357)
    at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:297)
    at java.base/java.lang.reflect.Method.checkCanSetAccessible(Method.java:199)
    at java.base/java.lang.reflect.Method.setAccessible(Method.java:193)

When code is migrated from Java8 to Java9, WinRegistry.java file is modified with some of the methods' input parameter(s) type from int to long





Aucun commentaire:

Enregistrer un commentaire