Results 1 to 2 of 2

Thread: classnotfound

  1. #1
    mirror666 is offline Member
    Join Date
    Nov 2008
    Rep Power

    Default classnotfound

    hi guys. im new to java and im trying to run in a webpage a particular application i found.
    i can compile the class successfully ( java 6 update 10 ) with "javac" but when i try to run it both in the command line and through a webpage i get an error like this :

    error when i run in it in the command line :
    Java Code:
    Exception in thread "main" java.lang.NoClassDefFoundError: sender (wrong name: net/sender)
            at java.lang.ClassLoader.defineClass1(Native Method)
            at java.lang.ClassLoader.defineClass(
            at Method)
            at java.lang.ClassLoader.loadClass(
            at sun.misc.Launcher$AppClassLoader.loadClass(
            at java.lang.ClassLoader.loadClass(
            at java.lang.ClassLoader.loadClassInternal(
    Could not find the main class: sender.  Program will exit.
    error message from java console ( when i run it in a webpage ) :
    Java Code:
    java.lang.NoClassDefFoundError: sender (wrong name: net/sender)
    	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: sender (wrong name: net/sender)
    this is the html ( how i'm running it through a webpage :
    Java Code:
     <applet applet code="sender.class" width=300 height=120>
    now i noticed this error is probably because of the "package net;" first line. but if comment it out, i will get other errors when running the app.
    any help would be greatly appreciated.
    Attached Files Attached Files

  2. #2
    Nicholas Jordan's Avatar
    Nicholas Jordan is offline Senior Member
    Join Date
    Jun 2008
    Rep Power



    I take out the packaging statements, then build in NetBeans with them in place after I get the program running.

    Sounds like a package && classpath issue, I never did get that working correctly and just work manually to avoid all the convoluted crannies.
    Introduction to Programming Using Java.
    Cybercartography: A new theoretical construct proposed by D.R. Fraser Taylor

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts