Monday, October 27, 2014

Enable Eclipse IDE for Scala Programming

If you are looking for enabling your Eclipse environment for Scala Programming, here are the steps I followed:

1.) Install Eclipse IDE (I chose Kelper version 4.3.2). If you already have Eclipse IDE, open it.

2.) Open Eclipse Market place - search for "Scala". The first result you get is "Scala IDE 3.0" as shown in the screenshot below. Click "Install" button.






3.) This will install the necessary jar files and plugins required to start programming in Scala.

4.) Once done, create a new "Scala Project".



5.) In this scr folder create a new package com.scala.sample. In this folder create a new Scala Class:



6.) Copy following code in your class:


package com.scala.sample

class ScalaSample1 {
  
  def testMe = {
    println("My Scala Sample");
  }

}


object ScalaObject {
  
  def main(args: Array[String]) {
  
    println(new ScalaSample1().testMe);
    
  }
  
}


7.) Save and run as "Scala Application".



Hurray!! You first scala program should be running by now.






No comments:

Post a Comment