12, the boot class loader

12.1, the boot class loader Introduction

  Built into the JVM startup class loader will load java.lang.ClassLoader and other java platform class, when the JVM starts, a special machine code runs, it will load the extension class loader and class loader system, this special class of machine code is called the boot loader (Bootstrap).

  Start class loader is not the java class and the other class loader is the class java.

  Start class loader is platform-specific machine instructions, it is responsible for opening the entire loading process.

  All class loader (except the boot class loader) are implemented as a java classes. However, always have a component to load the first java class loader, so that the entire loading process can proceed smoothly, load the first pure java class loader is the class loader to start duties.

  Start class loader will be responsible for loading jre for the basic components required for normal operation, which includes java.util and java.lang package classes and so on.

12.2、sun.misc.Launcher类

  And the extended system class loader class loader are two internal classes, defined in the Launcher inner class. Can " http://openjdk.java.net/ View" in the Launcher source class.

Package com.shtec.classLoader; 

Import of sun.misc.Launcher; 

public  class Test09 {
     public  static  void main (String [] args) { 
        
        // ClassLoader is loaded by the boot class loader 
        . System.out.println (ClassLoader class . getClassLoader ()); // null 
        
        // internal system and expansion Launcher defined class loader, is null, and the extended system described class loader is loaded by the boot class loader 
        . System.out.println (Launcher class .getClassLoader ()); // null 
    } 
}

Guess you like

Origin www.cnblogs.com/sunhao1234/p/12354832.html