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).
String one = args[0];
String two = args[1];
More Related Contents:
- How can I convert a JAR file to an EXE file?
- How to set order of jars in WebLogic?
- How do I bundle a JRE into an EXE for a Java Application? Launch4j says “runtime is missing or corrupted.”
- creating module-info for automatic modules with jdeps in java 9
- make your Jar not to be decompiled
- how to check the version of jar file?
- In maven how can I include non-java src files in the same place in the output jar?
- How to avoid copying dependencies with Ivy
- How to make an executable JAR file?
- Adding a library/JAR to an Eclipse Android project
- How do I read a resource file from a Java jar file?
- Difference between maven scope compile and provided for JAR packaging
- What is a fat JAR? [duplicate]
- Call “java -jar MyFile.jar” with additional classpath option
- Controlling Maven final name of jar artifact
- How to use classes from .jar files?
- How to write a Java program which can extract a JAR file and store its data in specified directory (location)?
- Eclipse is confused by imports (“accessible from more than one module”)
- java.lang.NoClassDefFoundError: Could not initialize class XXX
- Jar Mismatch Found 2 versions of android-support-v4.jar in the dependency list
- play .wav file from jar as resource using java
- How to include local jar files in Maven project [duplicate]
- Android Studio- Program type already present: com.google.android.gms.internal.measurement.zzwp
- Replacement System Classloader for Classes In Jars containing Jars
- Accessing JAR resources
- Adding 3rd party jars to WEB-INF/lib automatically using Eclipse/Tomcat
- Java – Loading dlls by a relative path and hide them inside a jar
- How do I compile a java file that has jar dependencies?
- Read directory inside JAR with InputStreamReader
- Run a scala code jar appear NoSuchMethodError:scala.Predef$.refArrayOps