David
David

Reputation: 241

java runtime cannot find scala standard library

I had a simple sbt project and I ran sbt package to generate a jar file. However, it seems my java runtime cannot find the default scala library. May I know how I can fix this issue ?

FYI, if I run with scala client_2.12-0.1.0-SNAPSHOT.jar everything works fine.

Thanks!

enter image description here

enter image description here

enter image description here

Upvotes: 1

Views: 250

Answers (2)

Alexey Romanov
Alexey Romanov

Reputation: 170713

You can use sbt-assembly or sbt-pack to create the complete package including dependencies. See their readmes and What are key differences between sbt-pack and sbt-assembly?.

Upvotes: 2

arjunsv3691
arjunsv3691

Reputation: 829

You need to specify Scala Library jar and other dependency jars when you run the sbt built jar with java

you can refer below link for more details

https://alvinalexander.com/scala/how-to-run-scala-sbt-packaged-jar-file-with-java-command

Upvotes: 1

Related Questions