Classloaders – back to basics…

Regular java application running from command line involve three classloaders
 
Bootstrap Classloader 
It is the parent of all the classloaders and loads  the standard JDK  classes in the lib directory of JRE (rt.jar and i18n.jar). All the “*. java ” classes are loaded by  this loader.
 
Extension Classloader 
It is the immediate child of bootstrap classloader. This classloader loads the classes in lib/ext directory of JRE.
 
System-Classpath Classloader 
It is the immediate child of Extension classloader. It loads the classes and jars specified by the CLASSPATH environment variable, java.class.path system property , -cp or -classpath command line settings. If any of the jars specified in one of the above manner have a MANIFEST.MF file with a Class-Path attribute , the jars specified by the Class-Path attribute are also loaded.
 
The three class loaders have a parent child relationship among themselves
 
clasloader
Rate this post

Leave a Reply