Link to home
Start Free TrialLog in
Avatar of sdc248
sdc248Flag for United States of America

asked on

pass arguments to an executable Jar file

Hi:

I have a program that accepts 0 or one argument. I know how to prepare manifest file, export the program to be an excutable jar file, and execute it on command line without taking any argument. But how do I do the same where I do need to pass an arguement?

Thanks.
ASKER CERTIFIED SOLUTION
Avatar of Mick Barry
Mick Barry
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of gauravkrtomar
gauravkrtomar

if u want to pass any arguments u can simply pass them in the command-line as given below:-

java -jar XYZ.jar abc def

where XYZ.jar is the name of the jar file and abc & def are the arguments (u can pass any number of arguments u want)
Avatar of sdc248

ASKER

Thanks guys. But how do I pass the argument dynamically? I am using a batch file that contains the command and the batch is scheduled to run daily with parameter of yesterday's date. I guess that means I need to add commands that get today's datetime, roll back one day, and use the result as my argument. Unfortunately I am not so familiar with DOS commands. I know this is a bit out of the scope but could you guys help?
Avatar of sdc248

ASKER

I've found a work around that doesn't need to do those scriptings. (Good for me!) Thanks.