WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.apache.ibatis.reflection.Reflector (file:/E:/my_java_jar/maven_repository/org/mybatis/mybatis/3.4.5/mybatis-3.4.5.jar) to method java.lang.Class.checkPackageAccess(java.lang.SecurityManager,java.lang.ClassLoader,boolean)
WARNING: Please consider reporting this to the maintainers of org.apache.ibatis.reflection.Reflector
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
在學習Mybatis框架的時候遇到這些警告,其原因是Mybatis版本與jdk版本的問題;使用jdk9及以上版本會出現以上問題:
我使用的是jdk11,注入的依賴是:
<dependency> <groupId>org.mybatis</groupId> <artifactId>mybatis</artifactId> <version>3.4.3</version> </dependency>
解決方法:
(1):使用jdk8及以下版本(並不推薦)
(2):修改mybatis依賴(修改mybatis版本)
<dependency> <groupId>org.mybatis</groupId> <artifactId>mybatis</artifactId> <version>3.5.3</version> </dependency>
問題成功解決........