aak
aak

Reputation: 41

intellij 2019.02 failed to run any scala class due to multiple scala lib version

In my build.sbt the scala version is "2.11.12" and Intellij version is 2019.2 community edition

enter image description here

and class path also having the same scala jar's version

enter image description here

When I running a scala class I got below error.

Error:scalac: Multiple 'scala-library*.jar' files (scala-library-2.11.12.jar, scala-library-2.11.12.jar) in Scala compiler classpath in Scala SDK sbt: org.scala-lang:scala-library:2.11.12:jar

I tried with multiple options to solve a problem 1.removed scala jars from class path 2. reimport project again 3. invalidate catch

still wont work any option

Upvotes: 1

Views: 204

Answers (2)

aak
aak

Reputation: 41

I found the issue, getting issue because there are two scala JDK 1. at project level 2. default at IntelliJ level

By default, the IntelliJ Scala compiler server is also available when running the scala classes.

Previously it was selected Now I just deselected (shown in below screen shot)and click on ok and then ran the classes and it works perfectly.

enter image description here

Upvotes: 0

zoran jeremic
zoran jeremic

Reputation: 2138

Most likely you have duplicate entry in one of the xml files in you .idea directory. You could search for it and delete extra entry, or just delete whole .idea directory and re-import your project

Upvotes: 0

Related Questions