Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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

like image 776
Jonathan Schneider Avatar asked Jun 03 '14 16:06

Jonathan Schneider


2 Answers

  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.

like image 182
Searene Avatar answered Sep 29 '22 20:09

Searene


Since IDEA 13 you should use SBT support which is bundled with Scala plugin.

With it there is no need to add third-party SBT plugins and run special commands; just import the project using "File -> Import project..." menu item, and it will automatically load SBT project structure and its dependencies.

like image 30
Vladimir Matveev Avatar answered Sep 29 '22 21:09

Vladimir Matveev