Java Reference
In-Depth Information
Many of these libraries are discussed and used in later chapters of this topic. When developing new
Java applications, it is important to consider the API to see if you can use some of the functionalities
that are already implemented. This saves you from having to program every aspect yourself, and it
can also make your program more recognizable and usable to other programmers. The API is flex-
ible and open, which means that new packages or libraries can be added to it on an ongoing basis.
Class Loader
The class loader locates and reads the *.class files needed to execute the Java program and loads
the bytecodes into memory. To safeguard a secure execution, it can assign different portions
(namespaces) of memory to locally versus remotely obtained classes. Classes are typically assembled
into libraries that are stored physically in JAR (Java Archive) files. The libraries may have been writ-
ten by the user or obtained externally. In order to locate the classes, the class loader will first find
the corresponding libraries and then load the classes as they are needed by the program (called on-
demand loading). The class loader basically has three subcomponents:
Bootstrap class loader
Extensions class loader
System class loader
The bootstrap class loader loads the core Java libraries located in <JAVA_HOME>/jre/lib . The con-
tents of this directory in the JRE7 environment are shown in Figure 2-3.
figure 2-3  
 
Search WWH ::




Custom Search