Scala Errors with JDK 1.8 in Intellij

I recently ran into problems with developing Scala in Intellij.

Screen Shot 2014-12-29 at 11.32.15 AMWhenever I tried to start a Scala console, evaluate a worksheet, or compile code, Intellij failed reporting an error relating to java.util.Comparator not taking type parameters:

Warning scalac ExtractAPI.scala:489 error java.util.Comparator does not take type parameters private[this] val sortClasses = new Comparator[Symbol] { ^…

Screen Shot 2014-12-29 at 11.28.47 AMTo resolve this issue, you need to configure Intellij to run Scala with JDK 1.7 instead of JDK 1.8.  Now, to accomplish this, It is not sufficient to set your Project SDK to Java 1.7, you will also have to remove Java 1.8 from your Platform Settings > SDKs. See the screen shots on the right.

You will then need to quit Intellij.  When you start Intellij back up it will tell you that I could not find Java 1.8.  Confirm the dialog to rebuild the Scala console and you will be able to use the Scala console in Intellij, evaluate worksheets, and compile Scala code.

Advertisements

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 )

Google+ photo

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

Connecting to %s