Java applet generated by netbeans won't run in html

Posted on 2009-04-19
Last Modified: 2013-12-14

As beginners in Java we made an applet in NetBeans which runs in the IDE without problems.
When we want to integrate the applet in a website with code
<APPLET code="classes/tamagotchi/Startscherm.class" width=350 height=200></APPLET>
(auto generated by NetBeans), the applet reports an error, stated below.
Can anybody tell us what is wrong and how to fix it?

Kindest regards.

java.lang.NoClassDefFoundError: Startscherm (wrong name: tamagotchi/Startscherm)
      at java.lang.ClassLoader.defineClass1(Native Method)
      at java.lang.ClassLoader.defineClass(Unknown Source)
      at Source)
      at sun.plugin2.applet.Applet2ClassLoader.findClass(Unknown Source)
      at java.lang.ClassLoader.loadClass(Unknown Source)
      at java.lang.ClassLoader.loadClass(Unknown Source)
      at sun.plugin2.applet.Plugin2ClassLoader.loadCode(Unknown Source)
      at sun.plugin2.applet.Plugin2Manager.createApplet(Unknown Source)
      at sun.plugin2.applet.Plugin2Manager$ Source)
      at Source)
Exception: java.lang.NoClassDefFoundError: Startscherm (wrong name: tamagotchi/Startscherm)
Question by:RBraat
    LVL 92

    Accepted Solution


    should be:


    Author Comment


    Your solution worked. We changed the path. On the webserver we also had to change the location of the class file to reflect the path in the html code.

    Thank you.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Maximize Your Threat Intelligence Reporting

    Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

    Programmer's Notepad is, one of the best free text editing tools available, simply because the developers appear to have second-guessed every weird problem or issue a programmer is likely to run into. One of these problems is selecting and deleti…
    Update (December 2011): Since this article was published, the things have changed for good for Android native developers. The Sequoyah Project ( automates most of the tasks discussed in this article. You can even fin…
    This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
    The viewer will learn how to use and create new code templates in NetBeans IDE 8.0 for Windows.

    761 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    12 Experts available now in Live!

    Get 1:1 Help Now