Setup development evironment for SCALA 2.9 and Netbeans 7.0 in linux (Ubuntu 11.04)

Install scala

  • Go to https://www.scala-lang.org/downloads and get the tgz package for Unix, MacOS X, Cygwin. The current latest stable release is scala 2.9.1
  • Suppose that the downloaded package is in your home directory, open the terminal and type these lines:
    $> tar -xvf scala-2.9.1.final.tgz
    $> sudo mv scala-2.9.1.final/ /usr/share/scala/

    Remember to replace the 2.9.1 by your scala version

  • The next thing to do is register the SCALA_HOME and PATH environment variable. To do this, open the ~/.profile file and add these new lines to the end of the file
    export SCALA_HOME=/usr/share/scala
    export PATH=$PATH:$SCALA_HOME/bin
  • Log out and the log in again. Test you installation by typing this command in the terminal. If the terminal change to scala> then you have successfully installed scala.
    $> scala

Install the Netbeans plugin

I use the nbscala plugin to develop scala projects. To use this plugin in Netbeans 6, you can use the Netbeans plugin management in Tools > Plugins. For Netbeans 7.0, you can do as below:

The first scala application

Now, you can create your first scala project in Netbeans. Just create a new project and keep the default settings, you will have a Hellow world scala application. Click Run. If the the string Hello world is printed in the output then your Netbeans is ready.

4 comments

  1. nguyenducminhkhoi on

    I think this tutorial is not completed if you set the system environment SCALA_HOME. Please check it!

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *