Java Reference
In-Depth Information
g
R e l e c t i o n
d
Figure 11-2. Classloader hierarchy
Extension classloader
This classloader is only used to load JDK extensions—usually from the lib/ext direc‐
tory of the JVM installation directory.
It has the primordial classloader as its parent. It is not widely used, but does some‐
times play a role in implementing debuggers and related development tools.
This is also the classloader used to load the Nashorn JavaScript environment (see
Chapter 12 ).
Application classloader
This was historically sometimes called the system classloader, but this is a bad name,
as it doesn't load the system (the primordial classloader does). Instead, it is the
classloader that loads application code from the classpath. It is the most commonly
encountered classloader, and has the extension classloader as its parent.
The application classloader is very widely used, but many advanced Java frame‐
works require functionality that the main classloaders do not supply. Instead, exten‐
sions to the standard classloaders are required. This forms the basis of “custom
classloading”—which relies on implementing a new subclass of ClassLoader .
 
Search WWH ::




Custom Search