ClassLoader classification and load order

ClassLoader classification What? What order is loaded? What is the order of class loading?

A: ClassLoader divided into four kinds: Jvm class loader (BootstarpClassLoader), Jvm extension class loader (extClassLoader), the system class loader (SystemClassLoader), custom class loader (the AppClassLoader)

----------------------------------------------------------------------------------------------------------------------------

ClassLoader load order:

=> Jvm class loader JAVA_HOME / lib all jar files

=> Jvm extended class loader JAVA_HOME / lib / jar files all ext

=> System class loader to load all jar files specified classpath

=> Custom class loader loads the custom ClassLoader class inherits the official implementation of the loader class file.

----------------------------------------------------------------------------------------------------------------------------

Class loading sequence is

Load -> link (+ verification + ready parsing) -> Initialize (preparation before use) -> Use -> Uninstall 

All jar files Jvm will be at startup to load the system must JAVA_HOME / lib,

Jvm for third-party classes will only be loaded with a lazy way, that is: when used again to load, will be loaded into the cache for subsequent use.

 

 

Reprinted: https://www.cnblogs.com/TravisGrady/p/10383119.html

Guess you like

Origin www.cnblogs.com/dingpeng9055/p/11201363.html