Take the 2-minute tour ×

I am a novice to the Eclipse IDE and the question is how can I run a Scala project as a Scala application by default? When I run the project by hitting the ⌘R key, it always asks how to run it, as a Scala or Java application. Is there a way to skip this and always run it as Scala by default?

I guess it's somehow related to the launch configuration, but when I try to make a new launch configuration for the project, it doesn't give me the option of Scala: only Java applet and Java application are shown as choices.

I appreciate your help in advance!

share|improve this question

1 Answer 1

up vote 2 down vote accepted

Window > Preferences > General > Keys

Scroll down and select Run Scala Application

Edit the Binding to ⌘R or whatever you want.

This changes the binding for your whole workspace, so it doesn't distinguish between Java and Scala applications. It would be nice if the runner had a box you could tick to choose the default, but this is a decent workaround.

share|improve this answer
Thanks for the answer, Luigi! By the way, is this really what they are doing? I can't believe they got the developers to hit 2 or 3 key sequences whenever they build and run the code. :/ –  K J Jun 4 '12 at 16:23
It's only one key sequence and you can bind it to a single key (say, F11) if you want, so it's just a single keypress. The only disadvantages are a) to run a Java project in the same workspace you need to assign a different key, and b) the "run" button in the GUI, if you use that instead of the keyboard, still asks you how you want to run it. Neither of which is a big deal. –  Luigi Plinge Jun 4 '12 at 20:50

Your Answer


