0

I have to execute a jar in a command prompt having 2 argument.

1st arg = File Type 2nd arg = A file

Example: java -jar program.jar CSV My csvfile.csv

My problem is that when the main method is run, the args.length is equal to 3. And since I will read and process the file (My csvfile.csv), I am encountering a error that the file does not exists.

args[0] = CSV
args[1] = My
args[2] = csvfile.csv

Can I make it like:
args[0] = CSV
args[1] = My csvfile.csv

There was no assumption that the filename should not have spaces.

Ti J
  • 261
  • 2
  • 7
  • 15

0 Answers0