Open gioborelli opened 6 years ago
hello, I have a similar issue with java 17 now. Did you please solve it? thank you.
I can't even recall what this was about 😅
Sorry
Il ven 11 feb 2022, 10:40 cervenf @.***> ha scritto:
hello, I have a similar issue with java 17 now. Did you please solve it? thank you.
— Reply to this email directly, view it on GitHub https://github.com/OpenPojo/openpojo/issues/117#issuecomment-1036025890, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADKVU63FGTBXO4DMH2WM3TDU2TKR3ANCNFSM4FG55XIA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.
You are receiving this because you authored the thread.Message ID: @.***>
The problem is the use of reflection for JPMS modules residing within the JDK like in our case java.base/java.time
. Since Java 9 this produced warnings along the lines "Illegal Reflective Access..." but with Java 17 this grace period has ended and you have to tell the JVM if additional packages need to be "opened".
So for instance when using Maven surefire, you can use this approach
<argLine>
--add-opens java.base/java.time=ALL-UNNAMED
</argLine>
The issue can be resolved by using the maven-surefire-plugin which is compatible with Java 17 and adding --add-opens arguments.
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.0.0-M5</version>
<configuration>
<argLine>
--add-opens java.security.jgss/sun.security.krb5=ALL-UNNAMED
--add-opens java.security.jgss/sun.security.krb5.internal=ALL-UNNAMED
--add-opens java.base/java.time=ALL-UNNAMED
</argLine>
</configuration>
</plugin>
Hi, looks like openpojo 0.8.10 has some compatibility issues with java 9:
this was the test code: