Scala IDE (Eclipse) Run as Scala Application

user3052079 picture user3052079 · Nov 30, 2013 · Viewed 25.1k times · Source

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!

Answer

ajesh kumar picture ajesh kumar · Nov 27, 2014
  1. Right click on the scala object having main method
  2. Choose Run As -> Run Configurations
  3. Double click on Scala Application from Run Configurations window
  4. Type the Object Name in the Main Class: (for eg: if HelloWorld.scala is the object having main method, give it as HelloWorld)