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.
If is this possible, how to do that?
Create a Java JAR File Without Manifest If you do not want to include the manifest file to create a JAR file, you can use the alternative method that specifies the main class name with the command. Yet another method to create a JAR file is to specify the classpath and the package qualified class name.
The answer is the JAR file's manifest. The manifest is a special file that can contain information about the files packaged in a JAR file. By tailoring this "meta" information that the manifest contains, you enable the JAR file to serve a variety of purposes.
Yes, but since it is a library this class will be available in it too. It just seems weird to add a class in that has no function whatsoever. just delete the Main class. You didn't need to create it in the first place.
It is possible, you can specify the class to run from the command line:
java -cp yourJar.jar your.main.Class
Same question here:
How to run a class from Jar which is not the Main-Class in its Manifest file
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With