Setting up Scala on your Linux Machine and IDE

In this article, we will setup Scala in linux machine and will compare three popular IDE’s which support Scala and provide you my opinion which one is best.


  • Install Java

    Scala runs on JVM, (Java Virtual Machine) so I am going to assume you have JRE/JDK setup in your machine already if not go ahead and install sudo apt-get or yum install open-jdk or sun-java-6 etc

  • Download Scala

    Download Scala and copy to /usr/local/share/scala (I got it in /home/xxx/Programs/scala)

  • Make some sym links in your /usr/local/bin

    cd /usr/local/bin
    sudo ln -s ../share/scala/bin/scala scala
    sudo ln -s ../share/scala/bin/fsc fsc
    sudo ln -s ../share/scala/bin/scalac scalac
  • Type scala and you should expect a console something like this,
    Welcome to Scala version (OpenJDK Server VM, Java 1.6.0_22).
    Type in expressions to have them evaluated.
    Type :help for more information.

    scala> println("Hello World")
    Hello World

  • Another Example

    scala> val testList = List(1,2,3,4,5)
    list: List[Int] = List(1, 2, 3, 4, 5)
    scala> testList.foreach {i=> println(i)}

If you could execute above examples, then you have installed Scala successfully in your machine.

IDE Comparision

I have written classic Inheritance Shape example in Scala ,


Circle Triangle Square

using three competitive Java IDE’s.

I ruled out Netbeans quickly just because there is not much documentation out there and also not much developers are involved in writing Scala plugin right now. Intellij and Eclipse both support Scala very well. Both Intellij Community/Ultimate edition supports scala, To install Scala in Intellij go to plugins section and search scala and install Scala. In Eclipse, go to the link above and get the update site url and install plugin in Eclipse using update site option. For me Eclipse is better than Intellij because, I was able to write Scala code in Eclipse as the way I used to write Java code in Eclipse. This is my opinion for now, it will change as my Scala codebase grows. In my next post, I will try to explain how we convert a bloated Java application to Scala application.

Leave a Reply

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

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>