Need to pass command line args as a key value. As I have 6-7 input arguments of different type and I dont remember the key name if I accept them as a array of string
public void main(String arg[]){}
How can I fetch key value pair without doing any split or anything. Is there a library that supports fetching value of arguments by passing key name.
In what format I should pass? In what format I should fetch data passing key ?
java -jar myApplication.jar 10where"10"would be available atarg[0](remember everything passed isString). You can start here: baeldung.com/java-run-jar-with-arguments. And then take a look to this: stackoverflow.com/questions/7341683/…-Dkey=valuewherekeyshows up as a property. Otherwise, do straight command line parsing. There are a number of libs out there.