Trying to start a program created with the eclipse Scala plugin, I saw an error that the main class couldn’t be found. That was cryptic, as there was a main. Stranger still, this is a program I had run successfully before.
The first part of solving the problem was to look for clues in the Problems view. Opening it, I saw this:
error while loading Configgy, Scala signature Configgy has wrong version expected: 5.0 found: 4.1 in /Users/…
So the first error was due to the compilation failing and not producing a main class that eclipse could launch.
After further digging, the version error turned out to be caused by a mismatch between the Scala version (2.7.5) I used to compile the Configgy library and the Scala version (2.8) that the eclipse plugin used to compile the rest of the program. I didn’t install Scala 2.8, so how could this occur? The Scala plugin installs its own version of Scala. Because I had selected the nightly build version of the plugin, the Scala versions drifted apart during one of the eclipse updates.
You can tell which version the eclipse Scala plugin uses by looking at the jar name in the eclipse/plugins directory. Eg, scala.tools.nsc_2.75.final.jar
The solution was to revert to the stable, release version of the plugin. Do that by using this url in the eclipse Software Updates | Available Software | Manage Sites… list.
http://www.scala-lang.org/scala-eclipse-plugin
More complete directions here.
Hey Gary,
I’m having problems with the newest version of the plugin for 2.8, it refused to run runnable classes. Have you had that problem?
Best,
Michal Huniewicz
I haven’t tried 2.8 yet… Sorry.
–Gary
thanks, this helped a lot!
I couldn’t compile code generated by maven and downgrading from scala 2.8 to 2.7.7 made it working.