WARNING: An illegal reflective access operation has occurred


在运行java程序时有这个警告,虽然不影响运行,看着着实不爽,可以通过以下方式解决。

来自 https://blog.csdn.net/nangu0673/article/details/82820494 评论区

在JVM options 添加下面的参数就好了(意思是:If the reflecting code is in a named module, ALL-UNNAMED can be replaced by its name.): --illegal-access=deny --add-opens java.base/java.lang=ALL-UNNAMED

# 参数要放在前面以防止和其他参数混淆
java --illegal-access=deny --add-opens java.base/java.lang=ALL-UNNAMED -jar xxx.jar


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM