Q:

Scala main class error

My Program - HelloWorld.scala
object HelloWorld {
    def main(args: Array[String]): Unit = {
        println("Hello, world!")
    }
}

jar cvfe HelloWorld.jar HelloWorld HelloWorld*.class
After jar file is created i tried to get the output from jar file
java -jar HelloWorld.jar

but i got the error
    Exception in thread "main" java.lang.NoClassDefFoundError: scala/Predef$
        at HelloWorld$.main(HelloWorld.scala:12)
        at HelloWorld.main(HelloWorld.scala)
Caused by: java.lang.ClassNotFoundException: scala.Predef$
        at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(Unknown Source)
        at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(Unknown Source)
        at java.base/java.lang.ClassLoader.loadClass(Unknown Source)
        ... 2 more

A:

Add line 
Class-Path: /home/dmitin/.m2/repository/org/scala-lang/scala-library/2.1‌​2.3/scala-library-2.‌​12.3.jar

(i.e. your location of scala-library) to HelloWorld.jar/META-INF/MANIFEST.MF. 
Then 
java -jar HelloWorld.jar Dmytro 

produces 
Hello, Dmytro!

