to execute a jar file, at the first i installed openjdk pakeges and then next command:

java -jar ccnChat.jar

I got this error: Failed to load Main-Class manifest attribute from ccnChat.jar

then i tried another way: i right clicked on the jar file, and i marked allow executing file as program from permissions tab and i chose openjdk as its default program. then i double clicked on jar file but it didn't open. And there is not any message or error. Could u please help me that how can i execute this jar file?


"Failed to load Main-Class manifest" => This is not a problem with you JDK but only with your MANIFEST.MF file. Have you specified a main-class? Your manifest file should be like this :

Manifest-Version: 1.0
Created-By: 1.7.0_06 (Oracle Corporation)
Main-Class: MyPackage.MyClass

Then you could try to execute again :

java -jar ccnChat.jar

Use the following command: java -jar file.jar

The answer needs to haveat least thirty words, so here is some more text, just ignore it

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.