Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

No 'scala-library*.jar' in every new IntelliJ Scala Project

I have installed intelliJ-IDEA 2017.2.5 with scala plugin on Ubuntu 16.04LTS. When I create new scala project and try to run it I get:

Error:scalac: No 'scala-library*.jar' in Scala compiler classpath in Scala SDK SBT: org.scala-lang:scala-library:2.12.4:jar

I can fix it by going to Project Structure > Libraries, deleting libraries and adding them again.

Is there a way to change default library so I don't have to do this every time I create new project?

like image 610
motek96 Avatar asked Oct 19 '17 09:10

motek96


People also ask

How do I get Scala library in IntelliJ?

To start working with Scala in IntelliJ IDEA you need to download and enable the Scala plugin. If you run IntelliJ IDEA for the first time, you can install the Scala plugin when IntelliJ IDEA suggests downloading featured plugins. Otherwise, you can use the Settings | Plugins page for the installation.


2 Answers

If you are using sbt 1.0.2, this problem might be due to a bug in sbt. A fix is expected for sbt 1.0.3.

Related issues:

  • https://youtrack.jetbrains.com/issue/SCL-12591
  • https://github.com/sbt/sbt/issues/3560

Possible workarounds:

  • configure Scala version 2.12.3
  • OR downgrade to sbt 0.13.16
like image 188
CrazyCoder Avatar answered Sep 22 '22 11:09

CrazyCoder


Select checkbox "Use SBT shell for build and import" in Idea SBT settings. It might help.

like image 30
vnd Avatar answered Sep 26 '22 11:09

vnd