Error: scala: No 'scala-library*.jar' in Scala compiler library

jkschneider picture jkschneider · Jun 3, 2014 · Viewed 25.8k times · Source

Environment: Play 2.3.0/Scala 2.11.1/IntelliJ 13.1

I used Typesafe Activator 1.2.1 to create a new project with Scala 2.11.1. After the project was created, I ran gen-idea. The generated IDEA project fails to compile with the error:

Error: scala: No 'scala-library*.jar' in Scala compiler library in test

Am I doing something wrong? Workaround?

enter image description here

Answer

Searene picture Searene · Oct 4, 2017
  1. Open File -> Project Structures -> Libraries, remove any scala sdk in it, e.g. scala-sdk-2.11.8 in the following image. enter image description here

  2. Click on +, then Scala SDK. enter image description here

  3. Select the right Scala SDK from the list, for me, it's Ivy-Scala-2.11.8 shown in the picture.enter image description here

  4. Select the current project(mine is spark-test), click OK. enter image description here

  5. Then click OK to close it. enter image description here

  6. Run again, it should work now.