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.
It seems that the class
main.scala.Mal_ipcan't be found. Make sure that the class is included in your jar file, or reachable via theClass-Pathdirective on the manifest file.