Wednesday, May 2, 2012

SETUP DEVELOPMENT EVIRONMENT FOR SCALA 2.9 AND NETBEANS 7.0 IN LINUX (UBUNTU 11.04)


Install scala

  • Go to http://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:
    ?
    1
    2
    $> 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
    ?
    1
    2
    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 theterminal
    ?
    1
    $> scala
    If the terminal change to scala> then you have successfully installed 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.

Digg Google Bookmarks reddit Mixx StumbleUpon Technorati Yahoo! Buzz DesignFloat Delicious BlinkList Furl

0 comments: on "SETUP DEVELOPMENT EVIRONMENT FOR SCALA 2.9 AND NETBEANS 7.0 IN LINUX (UBUNTU 11.04)"

Post a Comment