I am trying to create a jar using the following command on a RHEL box
jar -cf first MANIFEST.TXT HelloWorld.class
the contents of MANIFEST.TXT is
Main-Class: HelloWorld
This is failing with the following error
Failed to load Main-Class manifest attribute from
first
I understand i need to create the manifest file which has Main-Class manifest even with this I cannot execute
java -jar first without an error
Thanks
Bhavya
See the example from
jar -help:You must specify
mso jar knows there is a manifest file and you should not omit the.jarfromfirst. This should work: