Appendix A. ClassLoaders and JBoss
When a Java application references Java classes, the Java Virtual Machine (JVM) uses a ClassLoader to load them into memory. The Delegation Model was introduced in Java 2 and organizes ClassLoaders into the following tree/hierarchy by using parent/child relationships, as shown in Figure A-1.
![]() |
The J2SE ClassLoaders do the following:
The Bootstrap (also called the primordial) ClassLoader has no parent, is the root of the ClassLoader tree, and loads core Java classes (
java.*) into the JVM.The Extension ClassLoader loads extension classes:
Classes that extend core Java classes—javax.*.
Classes from the Java Runtime Environment (JRE) lib/ext directory in the standard J2SE installation.
The System (also called the Application) ClassLoader loads classes and JARs from the system
CLASSPATH—theCLASSPATHenvironment variable and theclasspathargument on thejavacommand line.
If the current ClassLoader previously loaded a class, then the
ClassLoader returns the class to the client. If a class has not been
previously loaded, then according to the Java specification, a ClassLoader
must defer (or delegate) to its parent before trying to load the class
itself. For example, if an application references java.lang.String, the System ClassLoader delegates to the Extension ClassLoader, which in turn defers to the Bootstrap ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access
