Exception in thread "main" java.lang.ClassNotFoundException while executing a jar file

54 views Asked by At

I'm trying to execute a jar file and get the error - Exception in thread "main" java.lang.ClassNotFoundException . The program is in Scala language written in Intellij IDE using scala-sdk-2.13.0 and it was then converted to jar.

Inside the jar file, I could find my main class (mypgm.class) and the MANIFEST.MF inside META-INF points to mypgm. But still, I get this error. Can someone please let me know why this happens?

I even tried 'java -cp myjar1.jar mypgm' to run the jar. But the same error occurrs.

1

There are 1 answers

0
Alvaro González Sotillo On

It seems that the class main.scala.Mal_ip can't be found. Make sure that the class is included in your jar file, or reachable via the Class-Path directive on the manifest file.