开发者

False errors in eclipse?

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)
    开发者_如何学Cat 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.


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


Clean the project once. It remove those false error.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜