使用mybatis-plus JDK版本过高提示警告
1、在启动类中添加如下方法即可
报警告
public static void main(String[] args) {
disableWarning(); //禁用警告
SpringApplication.run(SecurityApplication.class, args);
}
//处理控制台异常
public static void disableWarning() {
try {
Field theUnsafe = Unsafe.class.getDeclaredField("theUnsafe");
theUnsafe.setAccessible(true);
Unsafe u = (Unsafe) theUnsafe.get(null);
Class cls = Class.forName("jdk.internal.module.IllegalAccessLogger");
Field logger = cls.getDeclaredField("logger");
u.putObjectVolatile(cls, u.staticFieldOffset(logger), null);
} catch (Exception e) {
// ignore
}
}
时间:2023-04-19 晚上


浙公网安备 33010602011771号