I'm trying to figure out, how I can execute Scala Code as an executable jar file.
So I've loaded a Hello World Script which just hast this code
object Main extends App {
println("Hello, World!")
}
This is located within src\main\scala\Main.scala
.
Now im running sbt package
to create a jar file.
However, I'm not able to run this file, it just won't do anything.
Also, by going in the directory and running it via java -jar HelloWorld.jar
is not working and I'm just getting the Error:
Error: Unable to initialize main class Main
Caused by: java.lang.NoClassDefFoundError: scala/Function0
However I have no clue why this happens and how to fix it.