???????????????????
????Java???????????ClassLoader??????ι????????????????
????Bootstrap ClassLoader
????Ext ClassLoader
????System ClassLoader
????Bootstrap ClassLoader??????ClassLoader???????????????C++??д??????JVM?е????JVM?????????????????Щ???????????磺rt.jar??resources.jar??charsets.jar??jce.jar????????????????????????Щ:
????URL[] urls = sun.misc.Launcher.getBootstrapClassPath().getURLs();
????for (int i = 0; i < urls.length; i++) {
????System.out.println(urls[i].toExternalForm());
????}
????????????ClassLoader????????ClassLoader?????Java??????????????????“??????”??????????????????????Bootstrap ClassLoader?????ClassLoader???????“??”????????? ????????????????????????????
????//ClassLoader.java
????public abstract class ClassLoader {
????...
????// The parent class loader for delegation
????private ClassLoader parent;
????...
????“??????”
??????ν“??????”?????????????????????и????????????????????????????????????????????????????????????????????“???????”??????????м?????????ClassNotFoundException????
??????????Bootstrap ClassLoader????????????????????Ext ClassLoader??System ClassLoader????????????????
????Ext ClassLoader??????????????????????Java??????????????JAVA_HOME/jre/lib/ext/???μ????е?jar??????????????????jar??????
????System ClassLoader????????????????????????ó???classpath???μ?????jar??class???????????????????jar?????cp?????μ?jar????
???????????????????????????????
????ClassLoader loader = Debug.class.getClassLoader();
????while(loader != null) {
????System.out.println(loader);
????loader = loader.getParent();
????}
????System.out.println(loader);
????“??????”??????
????????????“??????”???????????????????????????????д??????滻Java???Щ??????????String??????????????????????JVM????????????????????????????????class??????????ClassLoader??????????????????????????????java.lang.ClassCaseException.