问题
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!
回答1:
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.
来源:https://stackoverflow.com/questions/10872438/how-can-i-run-a-scala-project-as-a-scala-application-by-default-in-eclipse-ide