WARNING: An illegal reflective access operation has occurred WARNING: Illegal reflective access by net.sf.cglib.core.ReflectUtils$2 (file:/D:/maven/maven/apache-maven-3.6.1-bin/apache-maven-3.6.1/mvn_repo/cglib/cglib/3.1/cglib-3.1.jar) to method java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain) WARNING: Please consider reporting this to the maintainers of net.sf.cglib.core.ReflectUtils$2 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
时间: 2024-03-07 11:52:09 浏览: 392
这个是由于Java 9及以上版本引入了模块化系统,加强了对Java核心库的访问控制,而某些第三方库使用了Java核心库的非公开API,就会导致这种警告信息的出现。可以通过添加--add-opens命令行参数来解决这个问题,例如:--add-opens java.base/java.lang=ALL-UNNAMED。这样可以打开对java.base/java.lang包的访问,但这并不是推荐的做法,因为这可能会导致安全问题。更好的解决方案是更新使用的第三方库,或者等待它们更新以适应新的Java版本。
相关问题
WARNING: An illegal reflective access operation has occurred
This warning message indicates that the Java code is using a feature that is not officially supported or recommended by the Java development team. This can be caused by using an outdated or deprecated API, or by using a third-party library that is not compliant with the latest Java standards.
While this warning message does not necessarily mean that the code is broken or will not function, it is a good idea to investigate why the code is generating this warning and see if there is a more compliant way to achieve the same functionality. Ignoring this warning could result in compatibility issues or security vulnerabilities in the future.
warning: an illegal reflective access operation has occurred
这是一个由于 Java 程序运行时反射操作导致的错误。反射是 Java 程序中用于在运行时访问、操作类、接口、字段和方法的机制,但是反射操作也可能会导致安全问题。请检查程序代码是否正确使用了反射操作。
阅读全文