Professional Documents
Culture Documents
http://java.sun.com/docs/books/tutorial/ext/basics/install.html
Installed Extensions: Installed extensions are JAR files in the lib/ext directory of the
Java Runtime Environment (JRE ) software.
TM
The JRE consists of those directories within the highlighted box in the diagram. Whether
your JRE is stand-alone or part of the JDK software, any JAR file in the lib/ext of the
JRE directory is automatically treated by the runtime environment as an extension.
Download Extensions
Download extensions are sets of classes (and related resources) in JAR files. A JAR file's
MANIFEST.MF can contain headers that refer to one or more download extensions. The
extensions can be referenced in one of two ways:
• by a Class-Path header
• by an Extension-List header
Note that at most one of each is allowed in a manifest. Download extensions indicated by
a Class-Path header are downloaded only for the lifetime of the application that
downloads them, such as a web browser. Their advantage is that nothing is installed on
the client; their disadvantage is that they are downloaded each time they are needed.
Download extensions that are downloaded by an Extension-List header are installed
into the /lib/ext directory of the JRE that downloads them. Their advantage is that they
are downloaded the first time they're needed; subsequently they can be used without
downloading. But as shown later in this tutorial, they are more complex to deploy.
You can list multiple URLs in a manifest. For example, the following is a valid header:
Class-Path: area.jar servlet.jar images/
In the Class-Path header any URLs listed that don't end with '/' are assumed to be JAR
files. URLs ending in '/' indicate directories. In the preceding example, images/ might
be a directory containing resources needed by the applet or the application.
f you need to specify more class path entries than will fit on one line, you can extend
them onto subsequent continuation lines. Begin each continuation line with two spaces.
For example:
3. The class path: classes, including classes in JAR files, on paths specified by the
system property java.class.path. If a JAR file on the class path has a manifest
with the Class-Path attribute, JAR files specified by the Class-Path attribute
will be searched also. By default, the java.class.path property's value is ., the
current directory. You can change the value by using the -classpath or -cp
command-line options, or setting the CLASSPATH environment variable. The
command-line options override the setting of the CLASSPATH environment
variable.
The Java platform uses a delegation model for loading classes. The basic idea is that
every class loader has a "parent" class loader. When loading a class, a class loader first
"delegates" the search for the class to its parent class loader before attempting to find the
class itself.