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/
In the worst case - create the project once again with all the imports from the beginning. In my case none of the other options worked. This type of error hints that there is an error in the project settings. I once managed to solve it, but once further developments were done, the error came back. Recreating everything from the beginning helped me understand and optimize some links, and now I am confident it works correctly.
In Eclipse, make sure you add your source folder in the project properties -> java build path -> source. Otherwise, the main() function may not be included in your project.
You have to make sure that your .java files are in the .src folder in eclipse. I had the same exact problem until I got it figured out.
A quick solution:
First, exclude the package: Right click on the source package >> Build Path >> Exclude
Then include it back: Right click on the source package >> Build Path >> Include
That code is valid. Have you tried to compile it by hand using scalac? Also, have you called your file "addressbook", all lowercase, like the name of the object?
Also, I found that Eclipse, for some reason, set the main class to be ".addressbook" instead of "addressbook".
May be the file you have created is outside the src(source) folder. Trying to call the class object(from the file located in the src folder) from the .java file outside the source folder results in the same error. Copy .java file to the source folder, then build it. The error will be gone.