哪个类加载器负责将认可的目录 jar 加载到 JVM 中?
which classloader responsible for loading endorsed dir jars into JVM?
我问这个问题是为了了解我的知识。在 java 中,我们有三个 class 加载器 bootstrap,系统和扩展 class 加载器。其中哪一个将实际加载认可的罐子?
加载认可的 jar 的是 bootstrap 类加载器。
您可以在 Java 认可标准覆盖机制中找到更多信息
.
总结一下它的用法 - Java SE 运行时环境将在此类 JAR 文件中使用 类 来覆盖相应的 类发货时的 Java 平台。所以认可的罐子比 JDK 捆绑罐子有更高的偏好。
通过 bootstrap class 加载程序。
查看相关HotSpot sources:
// Constructs the system class path (aka boot class path) from the following
// components, in order:
//
// prefix // from -Xbootclasspath/p:...
// endorsed // the expansion of -Djava.endorsed.dirs=...
// base // from os::get_system_properties() or -Xbootclasspath=
// suffix // from -Xbootclasspath/a:...
//
// java.endorsed.dirs is a list of directories; any jar or zip files in the
// directories are added to the sysclasspath just before the base.
我问这个问题是为了了解我的知识。在 java 中,我们有三个 class 加载器 bootstrap,系统和扩展 class 加载器。其中哪一个将实际加载认可的罐子?
加载认可的 jar 的是 bootstrap 类加载器。
您可以在 Java 认可标准覆盖机制中找到更多信息 .
总结一下它的用法 - Java SE 运行时环境将在此类 JAR 文件中使用 类 来覆盖相应的 类发货时的 Java 平台。所以认可的罐子比 JDK 捆绑罐子有更高的偏好。
通过 bootstrap class 加载程序。
查看相关HotSpot sources:
// Constructs the system class path (aka boot class path) from the following
// components, in order:
//
// prefix // from -Xbootclasspath/p:...
// endorsed // the expansion of -Djava.endorsed.dirs=...
// base // from os::get_system_properties() or -Xbootclasspath=
// suffix // from -Xbootclasspath/a:...
//
// java.endorsed.dirs is a list of directories; any jar or zip files in the
// directories are added to the sysclasspath just before the base.