(1)BootstrapClassloader
加载Java基础类库,这些类库可以通过如下代码查看
(2)ExtClassLoader
扩展类加载器和系统类加载器在sun.misc.Launcher中定义
[quote]
[url]http://javasourcecode.org/html/open-source/jdk/jdk-6u23/sun/misc/Launcher.java.html#line.51[/url]
(package private) static class Launcher.AppClassLoader
The class loader used for loading from java.class.path.
(package private) static class Launcher.ExtClassLoader
[/quote]
查看Launcher.getBootstrapClassPath源码,实际上是通过System.getPropery("sun.boot.class.path")列举出来的
[url]http://javasourcecode.org/html/open-source/jdk/jdk-6u23/sun/misc/Launcher.java.html#line.360[/url]
(3)AppClassLoader
加载Java基础类库,这些类库可以通过如下代码查看
URL[] urls = sun.misc.Launcher.getBootstrapClassPath().getURLs();
for (URL aUrl : urls) {
System.out.println(aUrl.toExternalForm());
}
//result:
//file:/D:/apps/Java/jdk1.6.0_21/jre/lib/resources.jar
//file:/D:/apps/Java/jdk1.6.0_21/jre/lib/rt.jar
//file:/D:/apps/Java/jdk1.6.0_21/jre/lib/sunrsasign.jar
//file:/D:/apps/Java/jdk1.6.0_21/jre/lib/jsse.jar
//file:/D:/apps/Java/jdk1.6.0_21/jre/lib/jce.jar
//file:/D:/apps/Java/jdk1.6.0_21/jre/lib/charsets.jar
//file:/D:/apps/Java/jdk1.6.0_21/jre/classes
(2)ExtClassLoader
扩展类加载器和系统类加载器在sun.misc.Launcher中定义
[quote]
[url]http://javasourcecode.org/html/open-source/jdk/jdk-6u23/sun/misc/Launcher.java.html#line.51[/url]
(package private) static class Launcher.AppClassLoader
The class loader used for loading from java.class.path.
(package private) static class Launcher.ExtClassLoader
[/quote]
查看Launcher.getBootstrapClassPath源码,实际上是通过System.getPropery("sun.boot.class.path")列举出来的
[url]http://javasourcecode.org/html/open-source/jdk/jdk-6u23/sun/misc/Launcher.java.html#line.360[/url]
(3)AppClassLoader