Scala Eclipse Plugin: Snag Getting Started
Tonight I tried taking Scala for a spin.
I installed the Scala Eclipse plugin, created a
hello project, switched to Scala perspective in the IDE, created a
test package, and created an object
HelloWorld in it, with the code to print the customary message. When I tried to run this code by right-clicking the file by choosing
Run As -> Scala Application, the code throws up the error:
java.lang.NoClassDefFoundError: src/test/HelloWorld Exception in thread "main"
After a bit of digging around, I figured out what is wrong – when one right clicks as chooses
Run as -> Scala application, the run configuration created is incorrect. The
Scala Application Object is set to be
src.test.HelloWorld; changing it to
test.HelloWorld makes the code run fine. Posting this here to help others trying the plugin.