Answer the question
In order to leave comments, you need to log in
How to diagnose jar file launch problem?
Hello!
I built a jar -
I try to run it with the command: java -jar testjar.jar
as a result I get an error message:
Error: Could not find or load main class pak.Main
To diagnose the problem, I opened the jar file with 7-zip, as if this is an archive: inside there is a META-INF \ MANIFEST.MF file, in which the class to be launched is registered: "Main-Class: pak.Main"
there is also a pak \ Main.class file in the jar file (I extracted it from the archive, opened it in IDE, it is quite correct for itself, the pak package is defined there, inside which the Main class with the static main method)
looks (in my naive opinion) everything is fine, I don’t understand why such an error.
tell me how to find the problem?
Thank you.
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question