Making Scala and NetBeans work under Ubuntu Lucid Lynx

Scala is an object-oriented language designed for the Java Virtual Machine (JVM), and a very interesting language. The inventor of Groovy suggested that Groovy would never have been created if Scala was around at the time, and the inventor of Java named Scala as a language he’d use.

NetBeans is an integrated development environment (IDE) which is particularly suited for Java (and was developed in Java besides).

Getting Scala and NetBeans to work together requires some adaptation; the basic directions are at the NetBeans website. There are, however, some caveats to making this work, especially under Ubuntu.

Install NetBeans from the Ubuntu repositories; this will be version 6.8.

The version of Scala installed by default in Ubuntu (the current stable release, 2.7.7) is not suitable. The current release candidate (2.8.0-RC3) from scala-lang.org should be installed instead, and into a single directory – /usr/local/scala is a good location. When done, the directory should contain these directories:

  • bin
  • doc
  • lib
  • man
  • meta
  • misc
  • src

The directory which contains these will be SCALA_HOME. Create a file under /etc/profile.d/scala like so:

SCALA_HOME=/usr/local/scala

Then, add this to the file /etc/netbeans.conf (at the end of the netbeans_default_options):

-J-Dscala.home=/usr/local/scala -J-Xmx1024m

At this point, let’s add the modules to NetBeans to support Scala. Download the archives and unpack them.

Start NetBeans, and select the Tools menu, followed by selecting the Plugins menu item. This brings up a new window. Select the Downloaded tab. Click on the Add files button, and select all of the nbm files that you just unpacked. After they appear in the list (all checked), click on Install.

NetBeans will have to be restarted to complete the process.

To check and make sure that everything works, create a new project and check for a category folder for Scala. Also try selecting the Tools menu, and then Scala Platforms – make sure that the path is /usr/local/scala.

Have fun with NetBeans and Scala!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: