Vignesh
Vignesh

Reputation: 259

scala "console" command gives error "Missing scala-library.jar"

Under sbt, if I give "console" to start a REPL shell, I get the following error.

[error] stack trace is suppressed; run 'last scalaInstance' for the full output
[error] (scalaInstance) Missing scala-library.jar
[error] Total time: 1 s, completed Oct 7, 2019 12:45:07 PM

$ sbt scalaVersion
[info] Loading global plugins from C:..\plugins
[info] Loading settings for project test from plugins.sbt ...
[info] Loading project definition from C:xx\test\project
[info] Loading settings for project root from build.sbt ...
[info] scalaVersion
[info]  2.11.12

$ sbt sbtVersion
[info] sbtVersion
[info]  1.3.0

Upvotes: 4

Views: 1510

Answers (3)

pjanssen
pjanssen

Reputation: 1111

Somewhat unrelated but I ran into this error on one of my projects and deleting all caches (.m2, .ivy2, coursier) was not enough to fix this. I also had to clear out my .sbt folder (I assume emptying the boot directory). Be sure to backup any settings you still might need.

Upvotes: 1

Depanker Sharma
Depanker Sharma

Reputation: 72

Try assemblyOption in set: = (assemblyOption in set) .value.copy (includeScala = true)

Source: https://github.com/sbt/sbt-assembly

if this doesn't solve the issue, it could be a compatibility issue with a plugin which you might have installed, it means that you would have to delete the plugin directory in %HOME%. and %HOME%.ivy2 because it caches some artifacts locally.

If you are not able to find the plugin try deleting %HOME%.ivy2 and running the console again, as it will remove the cached artifacts.

You might want to refer https://pt.coredump.biz/questions/50313823/why-does-running-tests-through-jenkins-user-on-build-slave-fail-with-missing-scalalibraryjar

I hope it helps.

Upvotes: 1

Pritam Kadam
Pritam Kadam

Reputation: 2527

can you try updating scala version in your sbt build? for example,

scalaVersion := "2.13.0" 

Upvotes: 0

Related Questions