article 02





Applet packaged as .cab file ...






Documentation Contents
p, li {font-family: arial; font-size: 10pt;}



java.lang.ClassNotFoundException Thrown by ClassLoader

Symptoms

When running an applet in a browser by using the Sun JavaTM Runtime Environment (JRETM) implementation, a java.lang.ClassNotFoundException
is thrown by the ClassLoader. The same applet runs without any error under the
Microsoft Virtual Machine (VM).

Cause

This error is caused by applets being packaged as .cab files.
The .cab file is an archive format specific to Microsoft Windows
and it is not supported by the Sun JRE.

Resolution

Extract the applet classes and resources from the
.cab files and repackage them as .jar files using
the Java Archive File Format (JARTM) tool from Java Development Kit (JDK). Type the following command to repackage files as .jar files:
        jar cvf <jar_file>
<input_files>




Modify the <APPLET> tag in the HTML page to specify the .jar files in the archive attribute. For example, assume you have the following code:
        <APPLET code="MyApplet"
width=100 height=100>
        <PARAM name="cabbase"
value="package1.cab, package2.cab"> 
    </APPLET>

        You can modify the above code as shown in the following example:


<APPLET code="MyApplet" archive="package1.jar,
package2.jar" width=100 height=100>
</APPLET>


Related Information
        See the JAR tool documentation for more details.
 





Copyright © 1995-2010 Sun Microsystems, Inc. All Rights Reserved. Please send comments using this Feedback page.

Java Technology








Wyszukiwarka

Podobne podstrony:
NeHe Productions OpenGL Article #02
Margit Sandemo Cykl Saga o czarnoksiężniku (02) Blask twoich oczu
t informatyk12[01] 02 101
introligators4[02] z2 01 n
02 martenzytyczne1
OBRECZE MS OK 02
02 Gametogeneza
02 07
Wyk ad 02
r01 02 popr (2)
1) 25 02 2012
TRiBO Transport 02

więcej podobnych podstron