![]() | Documentation Contents |
java.lang.ClassNotFoundExceptionThrown byClassLoader
SymptomsWhen running an applet in a browser by using the Sun JavaTM Runtime Environment (JRETM) implementation, a
java.lang.ClassNotFoundExceptionis thrown by theClassLoader. The same applet runs without any error under the Microsoft Virtual Machine (VM).Cause
This error is caused by applets being packaged as
.cabfiles. The.cabfile 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
.cabfiles and repackage them as.jarfiles using theJava 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.jarfiles in thearchiveattribute. 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 © 1993, 2010, Oracle and/or its affiliates. All rights reserved. Please send comments using this Feedback page. |
Java Technology |