Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1193
  • Last Modified:

Java applet generated by netbeans won't run in html

Hello,

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 java.security.SecureClassLoader.defineClass(Unknown 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$AppletExecutionRunnable.run(Unknown Source)
      at java.lang.Thread.run(Unknown Source)
Exception: java.lang.NoClassDefFoundError: Startscherm (wrong name: tamagotchi/Startscherm)
0
RBraat
Asked:
RBraat
1 Solution
 
objectsCommented:
>


should be:



0
 
RBraatAuthor Commented:
Hello,

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.
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now