我有一个可执行 Jar,它使用反射来访问一些 Java 内部(实际上我正在隐藏一些第三方库,如 Netty、DNSJava ......)
我看到将此条目添加到 Jar 的 MANIFEST
Add-Opens: java.base/sun.net.dns
解决了我的第一个问题:
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
但现在我有第二个警告:
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
我需要添加这个新的例外
Add-Opens: java.base/java.util
我正在尝试:
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
没有结果。我找不到任何关于 Add-Opens 的“规范”
吃鸡游戏
慕尼黑的夜晚无繁华
慕工程0101907
相关分类