Multiple scala libraies causing error in intellij?

intellij choose scala version
error scalac
scala compiler classpath intellij
intellij scala compiler jars not found
intellij scala-library is not specified
cannot infer scala class path because no scala-library jar was found
scala sdk intellij
create a new scala gradle project in intellij

I am using intellij 14 with scala 2.11.6 installed using home brew and symlink using

ln -s /usr/local/Cellar/scala/2.11.6/libexec/src /usr/local/Cellar/scala/2.11.6/src
ln -s /usr/local/Cellar/scala/2.11.6/libexec/lib  /usr/local/Cellar/scala/2.11.6/lib
mkdir -p /usr/local/Cellar/scala/2.11.6/doc/scala-devel-docs
ln -s /usr/local/Cellar/scala/2.11.6/share/doc/scala /usr/local/Cellar/scala/2.11.6/doc/scala-devel-docs/api

I tried running a simple hello world but run into the following issue.

Error:scalac: Multiple 'scala-library*.jar' files (scala-library.jar, scala-library.jar, scala-library.jar) in Scala compiler classpath in Scala SDK scala-sdk-2.11.6

Edit:

So I check the compiler class path on global libraries and apparently there are multiple scal-library.jar

file:///usr/local/Cellar/scala/2.11.6/idea/lib/scala-library.jar
file:///usr/local/Cellar/scala/2.11.6/lib/scala-library.jar
file:///usr/local/Cellar/scala/2.11.6/libexec/lib/scala-library.jar

Does anyone know why?

Maybe you have used

/usr/local/Cellar/scala/2.11.6/

as the path for Scala SDK?

When you install scala with homebrew that path will contain not only the scala libraries, but also a symlink with the relevant libraries for intellij. So if you use the top-level install directory intellij will find the libraries twice.

Instead you should use

/usr/local/Cellar/scala/2.11.6/idea/lib

Multiple 'scala-library*.jar' files in Scala compiler classpath when , Error:scalac: Multiple 'scala-library*.jar' files (scala-library.jar, scala-library.jar, scala-library.jar) in Scala compiler classpath in Scala SDK scala-sdk-2.11.6 Edit:​  External Libraries > [Right Click] sbt: org.scala-lang:scala-library:x.x.x:jar > Open Library Settings > Project Settings > Libraries There's a section with Classes, Sources, & JavaDocs. Click JavaDocs & remove it with the minus sign above.

I had the same issue than you experimented and the solution, actually very easy, was actually erasing the .idea folder from the project, the problem is that the configuration inside of this folder (containing the set ups for example for the test, VCS, the runs, etc) gets corrupted with double entries (probably cos you update your Scala version), once you do this and reopen the project in Intellij the IDEA will generate a fresh new configuration for you.

Multiple scala libraies causing error in intellij? - scala - html, I have just started trying to use Scala with IntelliJ. I get this error: Error:scalac: Multiple 'scala-library*.jar' files (scala-library.jar, scala-library.jar) in Scala compiler classpath in all jars from both folders were imported, causing the duplication. "Error:scalac: No 'scala-library*.jar' in Scala compiler classpath in Scala SDK SBT: org.scala-lang:scala-library:2.11.10:jar" Without touching the default build.sbt file (leaving it just as it was when I created the project using the wizard), I create a package called "org.public_domain".

This worked for me. I'm using Idea 2019.2.2 and Windows 10.

In the folder .idea/libraries/ I had two files: sbt__org_scala_lang_scala_library_2_13_0_jar.xml and sbt__org_scala_lang_scala_library_2_13_0_jar2.xml.

I deleted the second file. Then I opend the first one and there were duplicate lines:

    <root url="file://$USER_HOME$/AppData/Local/Coursier/cache/v1/https/repo1.maven.org/maven2/jline/jline/2.14.6/jline-2.14.6.jar" />
    <root url="file://$USER_HOME$/AppData/Local/Coursier/cache/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-compiler/2.13.0/scala-compiler-2.13.0.jar" />
    <root url="file://$USER_HOME$/AppData/Local/Coursier/cache/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-compiler/2.13.0/scala-compiler-2.13.0.jar" />
    <root url="file://$USER_HOME$/AppData/Local/Coursier/cache/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-library/2.13.0/scala-library-2.13.0.jar" />
    <root url="file://$USER_HOME$/AppData/Local/Coursier/cache/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-library/2.13.0/scala-library-2.13.0.jar" />
    <root url="file://$USER_HOME$/AppData/Local/Coursier/cache/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-reflect/2.13.0/scala-reflect-2.13.0.jar" />

So I deleted duplicates and errors disappeared. Hope this will help someone else.

Why does IntelliJ seem to import my scala libraries twice?, The Scala plugin extends the Java plugin to add support for Scala projects. Scala projects need to declare a scala-library dependency. Note: This will only cause all classes to be recompiled if at least one input In a multi-project build, analysis files are passed on to downstream ScalaCompile IntelliJ IDEA Integration. When you install scala with homebrew that path will contain not only the scala libraries, but also a symlink with the relevant libraries for intellij. So if you use the top-level install directory intellij will find the libraries twice. Instead you should use /usr/local/Cellar/scala/2.11.6/idea/lib

I also ran into that error. The fix I found was to remove the duplicate scala-library in the .iml file generated by intellij.

Basically I located the relevant .iml file by grepping the scala version, and found that two scala-library in that file. I removed the scala 2.11 version, and then it works.

The Scala Plugin, In this tutorial, we'll see how to build a Scala project using sbt. sbt is a popular essential once you create projects with dependencies or more than one code file. The ~ causes sbt to rebuild and rerun the project when you save changes to a file You can find more published libraries on Scaladex, the Scala library index,​  According to Pavel Stating at IntelliJ Scala gitter channel. We added basic Dotty support in the IntelliJ Scala plugin a long time ago, right after the announcement of Dotty. However, for a long time Dotty has been a dark horse, and aiming at a moving target hadn't been easy.

2019 update... I'm running Ubuntu Linux and IntelliJ community 2019.1 with sbt 2.13.1 and got the exact same error. I also found that if I built directly from sbt with "runMain package.MyClass" it worked, so I knew it must be an IntelliJ problem, not a "real" problem.

Anyway, I found the file .idea/libraries/sbt.. lots of crazy long name ... scala_library_2_13_1_jar.xml.

In it, there was an XML block , and in that block, two entries were duplicated: I first noticed the scala-library one, and after deleting that, the error report came up about the scala-compiler duplicate too. After deleting both duplicates, my build is now working.

Building a Scala Project with IntelliJ and sbt, X Install bloop in project/plugins.sbt: addSbtPlugin("ch.epfl.scala" problem. IntelliJ IDEA reports: Error:scala: Multiple 'scala-library*.jar' files (scala-library-​2.13.0.jar, @jvican Any idea on what could be causing the issue? Assuming this is your first time creating a Scala project with IntelliJ, you’ll need to install a Scala SDK. To the right of the Scala SDK field, click the Create button. Select the highest version number (e.g. 2.13.2) and click Download .

bloopInstall generates duplicate entries with SBT 1.3.0-RC5, not , https://docs.scala-lang.org/getting-started-intellij-track/getting-started-with-scala-​in-intellij.html Error:scalac: Multiple 'scala-library*.jar' files (scala-library.jar, scala-library.jar) all jars from both folders were imported, causing the duplication. Using IDEA 10.5 and Scala plugin nightly build 1075, I was able to add the scalatest library to a test project, with source directories attached to the library, add an import for org.scalatest.Spec to a Scala class file in my test project and ctr-click to the source for the Spec class.

Why does IntelliJ seem to import my scala libraries twice?, SBT is the default build tool for the Scala programming community: you SBT lets you combine them all in any combination, and only later on does it error out if a task is not and causing people to have to structure/document which cells in the SBT is not the only Scala library which has multiple layers of  I'm trying to run a scala flatspec test within Intellij IDEA (latest community build, with latest Scala plugin), but I keep getting "Empty test suite" errors. I tried using the normal "run" menu on right click, but it does not work. I also tried creating a new ScalaTest configuration, but still the runner is not picking up the tests.

So, what's wrong with SBT?, @DoctypeRosenthal Yes, the Elm plugin is designed to support multiple Elm projects (elm-package.json files) within one IntelliJ project. However, the support for "package" projects (as opposed to applications) has a limitation: indirect dependencies are not currently loaded (full details on why here ).

Comments
  • Did you have another version of scala installed on your system?
  • I did brew uninstall scala and brew install scala with-docs don't know if that is causing the issue
  • Try Uninstalling scala from your system , run scala command if it show scala command not found that means it is completely un-installed, and then install it again.
  • yeah I tried brew uninstall scala again and run scala in terminal and it doesn't run scala, so I think there is no duplicates
  • SHIFT+CTRL+ALT+S, then remove the extra scala JARs from your library. This assumes you are building from your IDE.
  • how to change: File > Project Structure > Global Libraries > + > Scala SDK > Browse > choose /usr/local/Cellar/scala/your version/idea/lib