kostaskougios / cloning

deep clone java objects
Other
590 stars 112 forks source link

java.util.Date cloning error #118

Open lsliwko opened 2 years ago

lsliwko commented 2 years ago

As in title, the error is:

java.lang.reflect.InaccessibleObjectException: Unable to make field private static final sun.util.calendar.BaseCalendar java.util.Date.gcal accessible: module java.base does not "opens java.util" to unnamed module @76908cc0

JRE is Oracle's Java 17.0.3.1 (JDK) I am using the latest cloning-1.10.3.jar

fazaza commented 2 years ago

any update ?

omkar9999 commented 1 year ago

I was able to resolve the issue with-

java ${JAVA_OPTS:-} \ --add-opens java.base/java.util=ALL-UNNAMED --add-opens java.base/sun.util.calendar=ALL-UNNAMED -jar NAME_OF_JAR

You can read more about add-opens here