Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

scala

sbt

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
like image 988
Vignesh Avatar asked Nov 16 '25 15:11

Vignesh


2 Answers

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.

like image 121
Depanker Sharma Avatar answered Nov 18 '25 04:11

Depanker Sharma


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.

like image 32
pjanssen Avatar answered Nov 18 '25 04:11

pjanssen



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!