Getting started with Scala

by Michael

A while ago, I started playing around with Scala. To make things as easy as possible for me to write Scala code, I wanted to found out which IDE had the best support. The easiest to install was the Eclipse Scala plugin. All you need to begin writing Scala code is a JDK, Eclipse and the plugin URL. IntelliJ has a good plugin too, the installation requires one extra step where you have to install the Scala system before downloading the plugin.

Eclipse Scala Plugin

  1. Install a JDK – assume you’ve already done this, otherwise google “JDK” and download the latest version from Oracle.
  2. Install Eclipse – go to http://www.eclipse.org/downloads/ and download the most appropriate version for you.
  3. Copy the plugin URL from http://www.scala-ide.org/ by clicking on the button that looks like the one below
    Plugin URL button
  4. Open Eclipse, go to Help > Install New Software… and paste the URL into the address field (the one that says Work with:)
  5. Download the plugin and restart Eclipse.
  6. IMPORTANT: Now, start a Scala project. Once the project is set up, go to Scala > Run Setup Diagnostics… and make sure to check the field “Use Scala-compatible JDT content assist proposals”
  7. Done.

If you don’t do step 6, you will not get any suggestions when writing code, so make sure that you have completed step 6 before deciding not to continue with Eclipse.

IntelliJ Scala Plugin

  1. Make sure you have a JDK as in step 1 above for Eclipse.
  2. Install IntelliJ – the community edition is available for free and allows you to write Scala code. Go to http://www.jetbrains.com/idea/download 
  3. Download the Scala IzPack Installer from http://www.scala-lang.org/downloads and run the package.
  4. Start intelliJ and click on Open Plugin Manager (top of right column that has the title “Plugins”)
  5. Click on the “Available” tab and look for Scala. Right click on the plugin and choose to install it.
  6. Done.
Advertisements