Wednesday, September 9, 2015

How to run Java .jar without MANIFEST.MF?


Is it possible to run a Java app which doesn't contain MANIFEST.MF file? Of course, there's static main method,just lacks manifest file. And the app is depending on several external .jar files.
It is possible, you can specify the class to run from the command line:
java -cp yourJar.jar your.main.Class
Same question here:
shareimprove this answer
You can also add the manifest, with the following command:
jar  -uvfe  your.jar foo.bar.Baz
java -jar your.jar        # tries to run main in foo.bar.Baz
shareimprove this answer
Of course! Just use this:
java -cp MyJar.jar com.example.Main
shareimprove this answer
Yes , use this
java -cp myJar.jar package.className

No comments:

Post a Comment