Reputation: 25905
I made a Scala package and a Scala application in Eclipse, but every time I try to run it from Run > Run
, Eclipse asks me:
Select a way to run 'example.scala':
- Java Application
- Scala Application
How can I get Eclipse to know that the project or application file should always run as Scala?
Upvotes: 4
Views: 2997
Reputation: 53358
@soc describes a workaround to the problem. At the moment there is no other/better way to make this to work. It needs to be fixed in future.
Luckily, this issue is partially fixed in the current nightly build of the Scala IDE. There is a fix for another problem, that disables the "Run As Java" Option: Disable JavaLaunchableTester on Scala files
It works not for all cases, for example if one right clicks on a package the known "Run As" Options are displayed. But for objects with a main method it works quite well if one uses the "Run As" Option of the Source file.
Upvotes: 0
Reputation: 28453
Afterwards, Eclipse should ask you only once and remember that choice.
Upvotes: 6