0

This is a dummy question. Sorry to ask

I launch a jar that requires some inputs. I would like to automatize this step :

    $ java -jar foo.jar
    Type of treatment
    0  [x] Extraction of the delivery files
    1  [ ] Installing the patch or version
    input selection:
    0
    press 1 to continue, 2 to quit, 3 to redisplay
    1
    Select the log directory []
    /tmp/log
    press 1 to continue, 2 to quit, 3 to redisplay
    1

Basically, I have to answer "0 1 /tmp/log 1" everytime I am installing this jar and I would like to automatise the process.

I tried with a file "answer.txt" containing

0
1
/tmp/log
1

With the command :

java -jar foo.jar < answer.txt

However, it does not work. I am not the owner of the jar and I cannot modify it.

Any clue ?

iclman
  • 1,218
  • 9
  • 21
  • I did read https://stackoverflow.com/questions/456636/how-do-i-pass-parameters-to-a-jar-file-at-the-time-of-execution and tried java -jar foo.jar 0 1 /tmp/log 1 but it does not work either... – iclman Jan 10 '22 at 12:57

1 Answers1

0

This is actually not possible with that specific jar. The jar is indeed doing an installation in an interactive mode. I will contact the provider to check if there is any silent non-interactive mode

iclman
  • 1,218
  • 9
  • 21