这是个愚蠢的问题。很抱歉问你
我启动了一个需要输入的jar。我想使这一步骤自动化:
$ 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基本上,我必须回答"0 1 /tmp/log 1“,每次我安装这个罐子,我想要自动化的过程。
我试着用"answer.txt“文件
%0
1
/tmp/log
1个
有命令:
java -jar foo.jar < answer.txt
但是,它不起作用。我不是罐子的主人,我不能修改它。
有线索吗?
发布于 2022-01-10 15:44:24
对于特定的jar,这实际上是不可能的。jar实际上是在交互模式下进行安装。我将与供应商联系,以检查是否有任何静默的非交互模式。
https://stackoverflow.com/questions/70625179
复制相似问题