Reputation: 139
I'm relatively new to the scala language (and programming in general). I recently installed the JDK and the Scala IDE (for eclipse). The setup went smoothly, but I encountered an issue upon trying to run a Hello World application. When I attempt to "Run As" the only available options are "Java Applet" and "Java Application". How do I proceed in trying to run as a "Scala Application"? Many thanks in advance!
Upvotes: 14
Views: 26095
Reputation: 96
Run As
-> Run Configurations
Scala Application
from Run Configurations
windowMain Class
: (for eg: if HelloWorld.scala is the object having main method, give it as HelloWorld)Upvotes: 7
Reputation: 61
I did make the main class in Java and simple call previously renamed "main in Scala". After this both @Run As@ and @Export@ works fine
Upvotes: 0
Reputation: 6069
Try to click right button on the Scala object with main
method (not on the root project element). Then the "Run as... Scala application" menu item appears.
Upvotes: 3
Reputation: 33033
Make sure you have done all of the following steps:
New -> Scala project
. If you have already created or imported the project, you can right-click on the project's root directory, then choose Scala and then Add Scala Nature. Alternatively, if it's an sbt
project, you can use the sbt-eclipse plugin for sbt to generate an Eclipse project configuration for your existing project, and then reload the project in Eclipse.Upvotes: 3