9
votes

I am having the hardest time getting a fresh install of IntelliJ to work properly with Scala.

I've installed IntelliJ IDEA 13.1.4 and the Scala plugin on a Mac. In any project, the IDE complains it cannot find scala.concurrent (or any other package in scala-library) even though the library is listed under "External Libraries". What am I missing?

I've got the basic steps to reproduce down to:

  1. Install IntelliJ IDEA 13.1.4
  2. Install Scala plugin via IntelliJ plugins dialog
  3. Create a new Scala project (either SBT or non-SBT, doesn't matter)
  4. Define a new class and try to import scala.concurrent._

IntelliJ IDEA cannot resolve symbol concurrent

This happens with new or existing projects - even when provisioned via sbt gen-idea.

I've installed Scala and SBT via brew and even tried setting $SCALA_HOME to point to the brew install of scala (/usr/local/share/scala).

IntelliJ is listing the library in External Libraries but still can't resolve the symbol.

IntelliJ IDEA lists scala-library in External Libraries

I have been fighting with this for hours. What am I missing here?

2
You can go in file -> project structure -> modules and check if the scala module and check that the project structure is correctly built and/or the scala module is there.Ende Neu
I get this kind of errors when the JDK setting for a project is wrong, check that!johanandren
I have the same issue, did you figure out a solution for this?Roman

2 Answers

6
votes

I had the same issue. I fixed it with Invalidate Caches

File | Invalidate Caches / restart. Manual way on Mac with removing this folder:

~/Library/Caches/IntelliJIDEAXX

0
votes

I had the same issue and above advice didn't help me. After googling and reading JetBrains tickets, I found out that I had $JAVA_HOME variable pointing to JDK 1.7: JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home

Removing that from both current shell (unset JAVA_HOME) and shell's profile (in my case .zshrc) resolved the issue.