1、创建类

public class MyTest19 {

    public static void main(String[] args) throws  Exception {

        System.out.println(AESKeyGenerator.class.getClassLoader());
        System.out.println(MyTest19.class.getClassLoader());

    }
}

  查看打印结果

sun.misc.Launcher$ExtClassLoader@29453f44
sun.misc.Launcher$AppClassLoader@18b4aac2

  说明AESKeyGenerator类是由扩展加载器加载的。

 

 修改扩展加载器的加载路径为当前路径

-Djava.ext.dirs=./

再次打印,结果会抛出异常。

JVM 扩展类加载器1

相关文章:

  • 2022-02-07
  • 2021-12-27
  • 2021-11-11
  • 2021-09-20
  • 2022-12-23
  • 2022-01-06
猜你喜欢
  • 2021-08-11
  • 2022-12-23
  • 2021-12-26
  • 2021-08-21
  • 2021-08-13
相关资源
相似解决方案