1

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

2 Answers 2

2

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?.

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

Comments

1

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

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.