I tried to create an executable jar using this command:
jar -cvfm h.jar Manifest.mf Whatever1.class Whatever2.class
The manifest contains this:
Main-Class: Whatever1
But if I try to run the jar, I get: Failed to load Main-Class manifest attribute from my.jar
. I extracted the jar, and I saw that the contents of it's manifest were this:
Manifest-Version: 1.0
Created-By: 1.6.0_18 (Sun Microsystems Inc.)
Why was my manifest ignored?
EDIT: I know that using the -e
flag I can specify an entry point, and jar will generate a correct manifest, but I'd like to know how to make this version work.