Tarek Shaar wrote:

> Within my ClientSidePage.html I have an applet:
>
> <APPLET
>   CODE     = "ClientSide1.class"
>   NAME     = "ClientSide1"
>   WIDTH    = 400
>   HEIGHT   = 300
>   HSPACE   = 0
>   VSPACE   = 0
>   ALIGN    = middle
> >
> </APPLET>
>
> When I try to run my applet in Netscape I get the error:
> "java.lang.ClassFormatException: Wrong class name inside class file"
>

Do you by chance have a "package" declaration in your applet?  If you do, it's 
definitely going to cause you
problems, because the package name must then become part of the class name in the 
<APPLET> tag.

For example, if your class looks like this:

    package com.mycompany;

    public class ClientSide1 ... {

        ...

    }

then you'd need to say:

    CODE="com.mycompany.ClientSide1"

in your APPLET tag.

>
> even though the name of my class is ClientSide1.java and the name of the amin class 
>in the code is the same.
>
> When I run it using IE
> "Can't find class ClientSide1.class!!!!!Why Why !!!
>

This is even more evidence that you've probably got a package tag there.  If the HTML 
page you are describing is
in directory "public_html", and the class itself is in the package described above 
(com.mycompany), then the
class file must actually be in directory "public_html/com/mycompany" -- because the 
components of the package
name are treated like directories in the filesystem.  This is true for all Java 
classes, not just applets.

>
> The class file ClientSide1 and the html page clientSidePage.html are placed in the
> same directory "on my Java Webserver 2.0" in public_html.
>
> I tryed every thing but still the same errors
>
> Thanking every one in anticipation.
>
> Tarek
>

Craig McClanahan

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to