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!
Scala IDE (Eclipse) Run as Scala Application
26k views Asked by user3052079 At
4
There are 4 answers
3
On
Make sure you have done all of the following steps:
- Switch to the Scala perspective
- Make sure the project is registered as a Scala project, not a Java project or any other kind of project. When you create the project, you can do this with
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 ansbt
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. - Create an appropriate main object with a main method, if you don't already have one.
Run As
->Run Configurations
Scala Application
fromRun Configurations
windowMain Class
: (for eg: if HelloWorld.scala is the object having main method, give it as HelloWorld)