Click to See Complete Forum and Search --> : Why the browser cannot run the applet when the appletviewer can ?


Sachin
September 29th, 1999, 04:30 AM
Why the browser cannot run the applet when the appletviewer can ?

i have an simple Class file in the directory c:\cdir\named.class
and am having a HTML file in c:\named.html with code="cdir.named"
when i run the file as appletviewer named.html it shows the applet but when
i open the same html file from other browser it shows me the following error.

Applet cdir.named can't start error:java.lang.ClassFormatError

The Console reads as follows

Netscape Communications Corporation -- Java 1.1.2
Type '?' for options.
Symantec Java! ByteCode Compiler Version 210.065
Copyright (C) 1996-97 Symantec Corporation
# Applet exception: class c.named not found
java.lang.ClassNotFoundException: java/awt/event/ActionListener
at java.lang.ClassLoader.defineClass(Compiled Code)
at netscape.applet.AppletClassLoader.loadClass(Compiled Code)
at netscape.applet.AppletClassLoader.findClass(Compiled Code)
at netscape.applet.AppletClassLoader.loadClass1(Compiled Code)
* at netscape.applet.AppletClassLoader.loadClass(Compiled Code)
at netscape.applet.AppletClassLoader.loadClass(Compiled Code)
at netscape.applet.DerivedAppletFrame.run(Compiled Code)
at java.lang.Thread.run(Compiled Code)

jmich
September 29th, 1999, 05:09 AM
in the <applet>-tag of the HTML-code it should say :
CODEBASE="c:/cdir/" CODE="named.class"

if the HTML- and class-files are in the same library, you can use :
CODEBASE="." CODE="named.class"

Jesper