Scala With Eclipse

From mi-linux
Jump to navigationJump to search

Removing a broken plugin

If you have a Scala plugin installed and it doesn't work, it's probably a good idea to remove it first. Run Help > Software Updates > Manage Configuration..., select the feature of interest, and disable it with the task shown in the right window.

Installing the Scala plugin

  • In the Eclipse menus, go to Help > Install New Software.
  • Select all three available pieces of software in the dialog box and click on the Next button.
  • Accept the license agreement.
  • Click on the Finish button.
  • If Eclipse asks you if you want to restart now, say Yes.

Testing the plugin

  • Go to File > New > Scala project in the menus.
  • Give your project a name and click on Finish.
  • In your project, go to File > New > Scala Object in the menus and create a new object called Hello
  • In the object, add the following method:
def main(args: Array[String]) : Unit = {
    // println() prints a string to the console.
    println("Hello world!")
  • Click the Run button and if everything is working you should see 'Hello World!' printed in the console.