3

I'm using 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: "Selection does not contain a main type"

Does anyboby know how to solve this?

2
  • in NetBeans you get such error when SCALA_HOME environment variable is not set Commented Jan 20, 2011 at 22:51
  • This question is not about NetBeans. Commented Jan 21, 2011 at 1:18

1 Answer 1

3

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.

Sign up to request clarification or add additional context in comments.

3 Comments

My object is in package com.example
+1 WAS a known bug. It's fixed in the latest versions assembla.com/spaces/scala-ide/tickets/…. And in fact the Helios version is not yet supported.
As of Scala 2.9, the Application trait will migrate from being "not recommended" to being "advocated". The problems with it have been resolved and, after all, it is so much cleaner to write...

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.