Results 1 to 2 of 2
  1. #1
    arieltal is offline Member
    Join Date
    Sep 2012
    Posts
    34
    Rep Power
    0

    Default java.lang.NoClassDefFoundError

    hello, i've searched the forums and have found many posts about this particular error message,
    most of the posts reffers to something called a CLASSPATH.

    now my problem is that i have a class in my project, which worked fine, (i'm using netbeans IDE 7.2)
    today i came back pressed "run" button to see things, and suddenly i got this error message.
    Java Code:
    Exception in thread "main" java.lang.NoClassDefFoundError: marioclone/Enemy
    	at java.lang.ClassLoader.defineClass1(Native Method)
    	at java.lang.ClassLoader.defineClass(ClassLoader.java:791)
    	at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
    	at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
    	at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
    	at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
    	at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
    	at java.security.AccessController.doPrivileged(Native Method)
    	at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
    	at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
    	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
    	at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
    	at marioclone.MovingTile.getthemall(MovingTile.java:153)
    	at marioclone.Gamemanager.<init>(Gamemanager.java:45)
    	at marioclone.MarioClone.main(MarioClone.java:16)
    Caused by: java.lang.ClassNotFoundException: marioclone.Enemy
    	at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
    	at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
    	at java.security.AccessController.doPrivileged(Native Method)
    	at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
    	at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
    	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
    	at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
    	... 15 more
    i would like to emphasize again that this class - ENEMY, was working well yesterday... i have no idea what to do to fix
    this, as i mentioned there is a lto of talking about CLASSPATH, however when i open the properties menu of the project
    i have no clue what to do..
    Please help.

  2. #2
    arieltal is offline Member
    Join Date
    Sep 2012
    Posts
    34
    Rep Power
    0

    Default Re: java.lang.NoClassDefFoundError

    well in the meantime i deleted the Enemy.java file, opened a new one called Enemy.java, and pasted the text again..
    now it works,
    if anyone knows why this happans or how to fix without "fooling the system" i would appreciate.

Similar Threads

  1. java.lang.NoClassDefFoundError:
    By Gowramma in forum New To Java
    Replies: 0
    Last Post: 05-02-2012, 08:57 PM
  2. Replies: 5
    Last Post: 06-02-2010, 01:05 PM
  3. Replies: 3
    Last Post: 06-01-2010, 03:01 PM
  4. java.lang.NoClassDefFoundError
    By Psyclone in forum NetBeans
    Replies: 1
    Last Post: 02-28-2010, 11:03 PM
  5. java.lang.NoClassDefFoundError
    By noobie in forum Java Applets
    Replies: 5
    Last Post: 04-22-2009, 02:35 AM

Posting Permissions

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