How do I pass parameters to a JAR file at the time of execution?
To pass arguments to the jar:
java -jar myjar.jar one two
You can access them in the main() method of "Main-Class" (mentioned in the manifest.mf file of a JAR).
manifest.mf
String one = args[0]; String two = args[1];
1.4m articles
1.4m replys
5 comments
56.9k users