4

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
5
  • Which sbt version do you use? Commented Oct 7, 2019 at 10:55
  • 1
    Could you do a sbt clean sbt reload and sbt update? Commented Oct 7, 2019 at 10:57
  • @ElBaulP I did try that. After sbt update, when I try "console", I get the same Missing scala-library.jar error. Commented Oct 7, 2019 at 11:23
  • @Suma : I use 1.3.0. Commented Oct 7, 2019 at 11:23
  • 1
    Are you setting managedScalaInstance to false? scala-sbt.org/1.x/docs/Configuring-Scala.html Commented Oct 9, 2019 at 22:24

3 Answers 3

1

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.

Sign up to request clarification or add additional context in comments.

Comments

1

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.

Comments

0

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

scalaVersion := "2.13.0" 

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.