Just going through the sample Scala code on Scala website, but encountered an annoying error when trying to run it.
Here\'s the code: http://www.scala-lang.org/node/
I have this problem a lot with Eclipse and Scala. It helps if you clean your workspace and rebuild your Project.
Sometimes Eclipse doesn't recognize correctly which files it has to recompile :(
Edit: The Code runs fine in Eclipse
One more thing to check: make sure that your source file contains the correct package declaration corresponding to the subdirectory it's in. The error mentioned by the OP can be seen when trying to run a "main type" declared in a file in a subdirectory but missing the package statement.
I had the same problem. I tried all sorts of things. And I came to know that
Things I did:
Project properties >> Java Build Path >> Source
This solved the error.
A simpler way is to close the project and reopen it.
Follow the below steps:
***
Just close and reopen
*** your project in eclipse. Sometime there are linkage problems. This solved my problem