Setting up scala with IntelliJ

I have Intellij ultimate 11.1, with the scala plugin installed.

I installed scala 2.9.2 using homebrew, which put scala in:

/usr/local/Cellar/scala/2.9.2>



>which scala
/usr/local/bin/scala
>scala -version
Scala code runner version 2.9.2 -- Copyright 2002-2011, LAMP/EPFL

Creating a new java module project, I get this:

enter image description here

enter image description here

enter image description here

enter image description here

Can someone help me fix these issues, why didn't the scala plugin make this work out of the box? :)


You need to specify /usr/local/Cellar/scala/2.9.2/libexec directory on your first screenshot. This is Mac brew specific, the same case is valid for grails installed via brew.

Standard Scala distribution download has different layout which IDEA understands correctly, brew is creating libexec directory where it writes /lib and /src directories expected by IDEA.


Updated for Intellij 11.1.5

Here's a step by step for any of those who are trying to get Scala in IntelliJ up and running.

Download Scala Plugin

IntelliJ > Preferences > Plugins > Browse Repositories... > Scala Click Ok and allow IntelliJ to restart

Download Scala

In Terminal enter

brew install scala --with-docs

Setup symbolic links for IntelliJ discovery process

ln -s /usr/local/Cellar/scala/<version>/libexec/src /usr/local/Cellar/scala/<version>/src
ln -s /usr/local/Cellar/scala/<version>/libexec/lib /usr/local/Cellar/scala/<version>/lib
mkdir -p /usr/local/Cellar/scala/<version>/doc/scala-devel-docs
ln -s /usr/local/Cellar/scala/<version>/share/doc/scala /usr/local/Cellar/scala/<version>/doc/scala-devel-docs/api

Create Project in IntelliJ

Here you are going to create a Java project from scratch as you normally would. However, in the last step, you will select Scala in the "Technologies" page.

In the Use Scala Distribution enter /usr/local/Cellar/scala/<version>

In the Compiler dropdown select scala-compiler

Click Ok and you are ready to create your first Scala object

For reference -> http://scalacookbook.blogspot.com/2012/09/scala-for-intellij.html


The latest Brew has already realized this problem and created automatic symlinks upon installing Scala.

Firstly, install Scala with Documentation

brew install scala --with-docs

Secondly, provide the following path in IntelliJ

/usr/local/opt/scala/idea