哪个类加载器负责将已批准的dir jar加载到JVM中?

时间:2016-04-07 12:39:32

标签: java jvm classloader

我问这个问题是为了我的知识。在java中我们有三个类加载器bootstrap,系统和扩展类加载器。在这个人将实际装载背书罐?

2 个答案:

答案 0 :(得分:2)

引导类加载器加载了背书罐。

您可以在Java Endorsed Standards Override Mechanism 找到更多信息。

总结其用法 - Java SE运行时环境将使用此类JAR文件中的类来覆盖Java平台中提供的相应类。所以认可的罐子比JDK捆绑的罐子具有更高的优先级。

答案 1 :(得分:1)

通过bootstrap类加载器。

请参阅相关的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.
相关问题