Thursday, July 24, 2008

A novice Scala programmer: Eclipse vs. IntelliJ IDEA vs. Netbeans. Installation.

1. Eclipse vs. IntelliJ IDEA vs. Netbeans. Installation.
2. Eclipse vs. IntelliJ IDEA vs. Netbeans. Creating and running Scala project with Eclipse.
3. Eclipse vs. IntelliJ IDEA vs. Netbeans. Creating and running Scala project with IntelliJ IDEA.
4. Eclipse vs. IntelliJ IDEA vs. Netbeans. Creating and running Scala project with Netbeans.
5. A novice Scala programmer: Eclipse vs. IntelliJ IDEA vs. Netbeans.

This is a first article in a mini-series.

The Scala Programming Language
is a beautiful modern statically typed general usage language, combining object-oriented and functional programming approaches. It was originally developed for Java platform, but also exists for .NET. "During a meeting in the Community Corner (java.net booth) with James Gosling, a participant asked an interesting question: "Which Programming Language would you use *now* on top of JVM, except Java?". The answer was surprisingly fast and very clear: - Scala."

I. Which Integrated Development Environments support Scala?


Until recent time, it was impossible to find an acceptable IDE for Scala development. How could you expect any substantial usage of a language, if you almost have to write code in Notepad and then compile it from command line?

Fortunately, it looks like that things are changing. Right now there are [at least] three different development environments which has Scala plug-ins available: Eclipse, IntelliJ IDEA, and Netbeans. Unfortunately, all of them are for Java's breed of Scala, I didn't find any IDE supporting Scala for .NET.
Eclipse and Netbeans are free; to obtain a free copy of IntelliJ IDEA, one have to prove that he is an established Open Source developer, otherwise it's relatively expensive. On all three platforms you would need to install a [beta] plugin to be able to work with Scala. (Scala SDK itself is totally free.)

II. Installation.

It's easy to install Scala and to configure your machine:
1. Make sure you have a latest Java Runtime Environment or, better, Java Development Kit; see glossary for details). (I never tried to run Scala's .NET compiler, although I'm ASP.NET developer.)
2. Download and install latest Scala. Java installer works just fine. Read Getting Started with Scala and set environment variables. (If you are new to Scala, Programming in Scala book is a must.)

Here's how to install IDEs and corresponding plug-ins:
3. Eclipse.
Download and install latest stable release. I chose "Eclipse Classic".
Download and install New Scala Plugin beta (do not use "stable", it's very primitive and is not being maintained any more.)
Note, that you don't need to download plugin using browser. Instead start Eclipse, open Help Software Updates Available Software Add Site and use http://www.scala-lang.org/downloads/distrib/files/nightly/scala.update/ as a remote update site.

4. IntelliJ IDEA
Currently, to run Scala plugin you have to install a latest Diana EAP (beta) version of IntelliJ IDEA. Stable version of IntelliJ IDEA will not work with Scala plugin.
Start IntelliJ IDEA and go to File Settings IDE Settings Plugins Available. Select Scala and Sokoban, right-click and select "Download and Install". Do not select any other plugin, because they are incompatible with Diana EAP version of IntelliJ IDEA. Click OK.

5. Netbeans.
Currently, to run Scala plugin you have to install a latest nightly build of Netbeans. I installed a pack marked as All. A complete instruction of installing Netbeans and Scala beta plugin is written by plugin author.