Applet packaged as
.cabfile results injava.lang.ClassNotFoundExceptionthrown when applet runs.
SymptomsWhen running an applet in a browser using the Sun JRE, a
ClassNotFoundExceptionis thrown by theClassLoader. The same applet runs under the Microsoft 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
The workaround is to extract the applet classes and resources from the
.cabfiles and repackage them as.jarfiles using thejartool from JDK:
jar cvf <jar_file> <input_files>
The
<APPLET>tag in the HTML page will also need to be modified to specify the.jarfiles in thearchiveattribute. For example,
<APPLET code="MyApplet" width=100 height=100>
<PARAM name="cabbase" value="package1.cab, package2.cab">
</APPLET>should be modified as follows:
<
APPLET code="MyApplet" archive="package1.jar, package2.jar" width=100 height=100>
</APPLET>Related Information
Please refer to the JAR tool documentation for more details.