0

I have a jar file that allows me to install some software, this JAR request me to fill many fields everytime. I need to write a script or something to fill this data automatically. I know how to pass parameters to the JAR file but I dont know the parameters name so how can I get the parameters name ?

Jim
  • 117
  • 2
  • 12

1 Answers1

1

What about taking the input from a text file?

java -jar installer.jar <input.txt

with input.txt the consecutively asked inputs:

first-line
second-line
42

The < ... takes standard input from a file, > ... writes stdout, 2> ... writes stderr to a file.

You can also make a java class doing that with System.setIn(InputStream).

Joop Eggen
  • 107,315
  • 7
  • 83
  • 138