eclipse - Run class in Scala IDE - Stack Overflow
You need to run an object not a class as noted by urban_racoons. so you can run either:
object MyApp{ def main(args: Array[String]): Unit = { println("Hello World") } }
or
object MyApp extends App { println("Hello World") }
Scala can not run a class because the main method needs to be static. Which can only be created behind the scenes by the compiler from a singleton object in Scala. Create the object and "run as a Scala application" should appear in the "run" context sub menu as long as you have the Scala perspective open.
Read full article from eclipse - Run class in Scala IDE - Stack Overflow
No comments:
Post a Comment