Stock JDK classes and the “null” ClassLoader?

后端 未结 3 1662
南笙
南笙 2020-12-20 16:39

Hi guys : Im trying to debug a very strange class error by looking at the ClassLoaders for some dynamically created components. ClassLoaders are s

3条回答
  •  生来不讨喜
    2020-12-20 17:20

    Classloader of the bootstrap classes is null, it's not a java class.

    Do not mistake the classes found of the classpath and the ones loaded by the bootstrap loader. The latter is responsible for the core JDK classes usually found in rt.jar. It's a native classloader, hence no reference towards.

    The classes on the classpath are loaded by the System classloader, and the class of it can be specified via property.

    Morealso the null classloader is considered a security issue and there are checks based on the caller class having null classloader.

提交回复
热议问题