NoClassDefFoundError - processing/core/PApplet

edited December 2013 in Using Processing

Hey guys,

I need some help on embedding my Applet (written in Eclipse with the Processing Library) on a simple html file.

I used this code in the html file:

     <html>
    <body>
    <head>
    <title>Java Example</title>
    </head><p>
    This is the IPCam Applet</p><br>
    <br>
    <embed id="testapplet" type="application/x-java-applet;version=1.7" width="320" height="240" archive="test.jar" code="Test.class" pluginspage="http://java.com/download/" myParam="My Param Value" />
    </body>
    </html>

I also tried:

<applet code="Test.class" archive="test.jar"></applet>

The html and the jar file are located in the same directory. Within the project all classes are in the default package.

My little Java Project can be found using this link: http://www.computer-schuppen.eu/files/ipcapture.zip

As soon as I open the html with Firefox, Internet Explorer or Chrome I receive the error : NoClassDefFoundError - processing/core/PApplet

I'm thankful for any help!

Answers

  • You have to specify the core.jar in the HTML tag and to add it beside your own jar.

  • edited December 2013

    Thanks for your reply PhiLho

    What kind of tag is supposed to be made for adding the core.jar ? Another archive tag does not work, like:

    <applet code="Test.class" archive="test.jar" archive="core.jar"></applet>

    Isn't it just enough that the core.jar is added in the Buildpath in Eclipse? Does this affect my other two classes in my project?

  • HTML doesn't support multiple attributes in a tag! Try archive="test.jar,core.jar"

    Note that the applet tag is deprecated, in favor of the object tag.

  • Thanks for your reply.

    This works just fine. But I'll give the object tag a try as well. ( http://www.w3.org/TR/1999/REC-html401-19991224/struct/objects.html#edef-OBJECT )

  • edited January 2014

    I just recently tested my Java Program for displaying the output of an IPCam. It is working in Eclipse but I can't make it work on the applet.

    I added all jars of all my needed classes.

    I imported several libraries in my IPCapture Class:

    import java.awt.image.BufferedImage;
    import java.io.BufferedInputStream;
    import java.io.ByteArrayInputStream;
    import java.io.ByteArrayOutputStream;
    import java.io.IOException;
    import java.net.HttpURLConnection;
    import java.net.MalformedURLException;
    import java.net.URL;
    

    The applet doesn't show anything on runtime.

    What might be the problem?

    edit: This is the entire Eclipse Project: https://www.dropbox.com/s/r9gxc8bfqhhy1hu/ipcapture.zip

    edit2: I tried to add the rt.jar and another jar which contains all the libraries. It didn't work out unfortunately.

  • Sketches using hardware / IO must have their jar signed to run on the Web.

    Note that online applets using a specific hardware are prone to be used by a very limited category of visitors...

  • The Applet is supposed to work on just one specific network, which has the IPCam hooked up.

    So the applet should be able to work on each Computer within the network. The program belongs to a project during my field of studies at University.

    Sketches using hardware / IO must have their jar signed to run on the Web.

    How could this be accomplished?

  • "How could this be accomplished?"
    One way to do that is to search sign jar on Internet...

    There are also instructions in the Processing wiki: Sign an Applet

  • edited January 2014

    Signing the applet did not solve the problem. :(

    edit: Signing ALL jars worked.

Sign In or Register to comment.