noClassDefFoundError using Scala Plugin for Eclipse

Posted by Jacob Lyles on Stack Overflow See other posts from Stack Overflow or by Jacob Lyles
Published on 2010-03-29T01:15:05Z Indexed on 2010/03/29 1:33 UTC
Read the original article Hit count: 504

Filed under:
|
|

I successfully implemented and ran several Scala tutorials in Eclipse using the Scala plugin. Then suddenly I tried to compile and run an example, and this error came up:

Exception in thread "main" java.lang.NoClassDefFoundError: hello/HelloWorld
Caused by: java.lang.ClassNotFoundException: hello.HelloWorld
 at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
 at java.security.AccessController.doPrivileged(Native Method)
 at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
 at java.lang.ClassLoader.loadClass(ClassLoader.java:315)
 at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:330)
 at java.lang.ClassLoader.loadClass(ClassLoader.java:250)
 at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:398)

After this point I could no longer run any Scala programs in Eclipse. I tried cleaning and rebuilding my project, closing and reopening my project, and closing and reopening Eclipse.

Eclipse version number 3.5.2 and Scala plugin 2.8.0

Here is the original code:

package hello

object HelloWorld {
 def main(args: Array[String]){
  println("hello world")
 }
}

© Stack Overflow or respective owner

Related posts about scala

Related posts about eclipse