Error trying to start Scala Application inside Eclipse

I am using the Eclipse Scala plugin. I created a simple program:

object HelloWorld {
  override def main(args: Array[String]) {
    println("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: "The selection does not contain the main type"

Does anyone know how to solve this?

+3
source share
1 answer

This is a known bug . In the scala plugin version for eclipse that I use, this error is only repeated for objects in the default package.

By the way, using the Application sign is not recommended - for more details, see the relevant documentation .

+3
source

Source: https://habr.com/ru/post/1786793/


All Articles