I have installed Eclipse 3.5.2 and today\'s Scala plugin from /update-current (that\'s Scala 2.8 final.) I can compile and run Scala projects consisting of a single singleto
I'd solve similar problem by executig "Project->Clean.." with next automatically building.
I have faced this issue. I have just deleted the package name, created scala class, Written the same code, Set Build to "Build Automatically". Finally, It works perfectly fine.
If you are using Intellij, mark directory as source root
Just copy your XXX.scala file code. Remove the package and create a new Scala Class. Paste your XXX.scala code. (If you are using maven, do a maven clean and build.) Run configuration again. This works for me.
For me it was Eclipse specific problem. I noticed that .class
file wasn't built at all. So bin
directory doesn't have compiled classes.
When I manually compiled *.scala file using *.sbt and copied it to bin
directory it was working as expected.
I tried different tips and tricks and it wasn't worked until I reinstalled Scala plugin in Eclipse .
One possibility is that you are trying to launch using ctrl-F11, but from a different class.
The Scala Eclipse plugin does not obey the defaults for Java launching. In Preferences->Run/Debug->Launching, there are some options Launch Operation->Always Launch the previously selected application, etc. This currently does not work in the Scala eclipse plugin. To launch a specified main, you need to launch it from the editor for the class.
There has been a bug raised for this. http://scala-ide.assembla.com/spaces/scala-ide/tickets/1000023-scala-launch--does-not-follow-jdt-behaviour
EDIT: This is now (mostly) fixed.