I have an executable Jar which is using reflection in order to access some java internal (actually I am shading some third party library like Netty, DNSJava...)
I see that adding this entry to the MANIFEST of the Jar
Add-Opens: java.base/sun.net.dns
solves my first problem:
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.xbill.DNS.ResolverConfig (file:/home/diennea.lan/enrico.olivelli/dev/magnews/magnews.installer/target/magnews-24.05-SNAPSHOT.dev-b199bacf8f2-noci-installer.jar) to method sun.net.dns.ResolverConfiguration.open()
WARNING: Please consider reporting this to the maintainers of org.xbill.DNS.ResolverConfig
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
But now I have a second warning:
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.postgresql.jdbc.TimestampUtils (file:/home/diennea.lan/enrico.olivelli/dev/magnews/magnews.installer/target/example/.tmpPackage/packages/postgresql.jar) to field java.util.TimeZone.defaultTimeZone
WARNING: Please consider reporting this to the maintainers of org.postgresql.jdbc.TimestampUtils
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
And I need to add this new exception
Add-Opens: java.base/java.util
I am trying with:
Add-Opens: java.base/java.util,java.base/sun.net.dns
Add-Opens: java.base/java.util;java.base/sun.net.dns
Add-Opens: java.base/java.util:java.base/sun.net.dns
Without results. I can't find any "specification" about Add-Opens