When running an applet in a browser by using the Sun JavaTM Runtime Environment (JRETM) implementation, a
java.lang.ClassNotFoundExceptionis thrown by the
ClassLoader. The same applet runs without any error under the Microsoft Virtual Machine (VM).
This error is caused by applets being packaged as
.cabfile is an archive format specific to Microsoft Windows and it is not supported by the Sun JRE.
Extract the applet classes and resources from the
.cabfiles and repackage them as
.jarfiles 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>
<APPLET>tag in the HTML page to specify the
.jarfiles in the
archiveattribute. For example, assume you have the following code:
<APPLET code="MyApplet" width=100 height=100>
<PARAM name="cabbase" value="package1.cab, package2.cab">
You can modify the above code as shown in the following example:
APPLET code="MyApplet" archive="package1.jar, package2.jar" width=100 height=100>
See the JAR tool documentation for more details.
Copyright © 1993, 2011, Oracle and/or its affiliates. All rights reserved.