Reputation: 241
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!
Upvotes: 1
Views: 250
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
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