tags:

views:

55

answers:

1

Okay, so eclipse says my code has errors in it, but there are no red lines. When I try to run my project (Called Game2) it gives me this error:

java.lang.NoClassDefFoundError: Game2
Caused by: java.lang.ClassNotFoundException: Game2
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClassInternal(Unknown Source)
Exception in thread "main"

Now clearly I know my class exists, and I know I put a main method in it, so what the hell is eclipse trying to do?

Edit: Validation says there are no errors in my project.

+3  A: 

If Eclipse says there are errors but you are not actually sure what the problem is you can check the problems view (Ctrl-3, type 'problems', enter) to see what's wrong (e.g. project setup issues).

Fabian Steeg