Running IntelliJ with JDK 1.7 and Scala 2.10 on Mac OS X 10.9 Mavericks

2 minute read Published: 2014-01-02

Since the combination of OS X, Scala, and IntelliJ appear to be a moving target in the development world, I figured I'd go ahead and jot down how I got them up and running on my MacBook Pro. First things first, I used IntelliJ 13 (Community Edition), with Scala 2.10.3, which I installed using Homebrew (I will detail it below). In addition, I'm using the latest Java 7 JDK for Mac OS X from Oracle.

Installing ScalaπŸ”—

First things first, use Homebrew to install Scala, including the documentation, like I have detailed below.

$ brew install scala --with-docs

You will likely see a line about where to point IntelliJ in the post install message, similar to this:

==> Caveats
To use with IntelliJ, set the Scala home to:
 /usr/local/opt/scala/idea

And that's exactly what we are going to do...

Installing JavaπŸ”—

Make sure that you have the latest version of the Java JDK installed, I just downloaded the appropriate JDK from Oracle's site.

Preparing and Installing IntelliJπŸ”—

In order to get IntelliJ to work properly with the latest version of the Java 7 JDK, you need to edit the .app according to the instructions provided by the IntelliJ authors here. Almost there!

Starting a Scala ProgramπŸ”—

Now, that you have all of the tools installed, you need to start a Scala module in IntelliJ. Start by opening IntelliJ and starting a new Scala Module. Set the *Project SDKΒ *path to the location of where you installed Java 7. Mine was:

/Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home

Next, select Set Scala Home, and point it to the location of your Scala install, which was pointed out to us by Homebrew during our earlier install. Β In my case it was:

/usr/local/opt/scala/idea

IntelliJ should autodetect the necessary libraries and documentation path. Fill out the remainder of your projects information (name, etc), and then click Finish to get started.