JavaZone Logo

  1. Info - Java Class Files

    Here is the answer:
    1. First pack your class files with WinZip (none compression rate)
    2. Look at the example. I added the command Archive, so Netscape/Explorer can find the class file.
    That�s it !

    Example:
    "
    APPLET ARCHIVE="class.zip" CODE="java.class" WIDTH="100" HEIGHT="100""

    class.zip: This is the Archive file. In this archive is your class file.
    Here it�s called java.class, look at
    CODE="...". The file(s) in the archive
    has/have to be exactly the same name as the file in the
    CODE="..." command.

    3. No upload problems and you can add more then one class in such zip Archives !

    P.S.: It works with Netscape 3.0/higher and Explorer 3.02/higher !
  2. Troubleshooting

    If you see "Applet can't start: class ______ not found" in your browser's status line, it can mean:
    1.The .class file(s) are not named correctly. Java is case-sensitive, so be sure to follow precise capitalization.
    2.The .class file(s) are not in the correct directory. They should be located in the path indicated in the
    CODEBASE= portion of the <APPLET> tag, or the directory of your HTML document if no
    CODEBASE= is specified.
  3. When I load the page Netscape gives me a java.lang.ClassFormatError !

    Something is mangling the .class file. Most likely the .class files were uploaded to the
    SERVER as TEXT or MACBINARY rather than as RAW BINARY DATA. Make sure you put your ftp program in BINARY MODE before sending the files to the SERVER.

    The other possibility is that the web
    SERVER is sending the file to clients as TEXT rather than BINARY DATA. Make sure the web SERVER is configured to send files that end in ".class" with a MIME type of application/octet-stream. Many web servers send files as type TEXT/PLAIN which often works but causes problems on a few servers.

    It's also possible on some platforms that Netscape just can't find the .class file; that is, it isn't in the directory where Netscape is looking for it. Technically, this isn't really a ClassFormatError, but this is how Netscape reports it on some platforms and versions.

Soon more hints !

Copyrights 1997 by Matthias Kannengiesser