Error trying to run Scala Application inside Eclipse
I'm using Eclipse Scala plugin. I created a simple program:
object HelloWorld {
override def main(args: Array[String]) {
prin开发者_如何学Gotln("Hello World!")
}
}
I can run this program from the menu: Run As -> Scala Application
However, with this code
object HelloWorld extends Application {
println("Hello world!")
}
I get this error message: "Selection does not contain a main type"
Does anyboby know how to solve this?
This is a known bug. In a version of scala plugin for eclipse that I use this bug is repeatable only for objects in default package.
By the way, the usage of Application trait is not recommended - see corresponding documentation for details.
精彩评论