How can I run a Scala project as a Scala application by default in Eclipse IDE?

心已入冬 提交于 2019-12-23 09:29:31

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!