Version 9, last updated by Anonymous at July 12, 2011 10:47 UTC

Here's a short tutorial how to create a "Hello World" application with Eclipse. It assumes that you have installed the plugin as described above and switched to the Scala perspective (Window → Open Perspective → Other → Scala then click"OK").

  1. Create a new Scala project "hello"
    • First click the "New → Scala Project" item in the "File" menu. 
    • Enter "hello" in the "Project name" field.
    • Click the "Finish" button.
  2. Create a new Scala package in source folder "src"
    • Right-click on the "hello" project in the "Package Explorer" tab of the projects pane.
    • Select the "New → Package" menu item.
    • in the "New Package" window, enter "hello" in the "Name" field.
    • Press the "Finish" button.
  3. Create a Scala object HelloWorld with a main method
    • First expand the "hello" project tree and right-click on the "hello" package
    • Select the "New → Scala Object" menu item and enter HelloWorld in the "Object name" field. 
    • Press the "Finish" button.
  4. Extend the code to print a message
    • Make the HelloWorld object implement the main method and add a println statement (see image, below).
  5. Create a Run configuration for the Scala project
    • Right click on HelloWorld.scala in the Package Explorer,
    • Select "Run as ..." and select "Scala Application"
    • Select the first matching item, the "HelloWorld" class.
    • Click the "Ok" button.

Hello World code screenshot

A similar example is also covered in the screen cast video on the Requirements and Installation page.