【发布时间】:2022-01-10 23:44:24
【问题描述】:
这是一个愚蠢的问题。不好意思问了
我启动了一个需要一些输入的 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
基本上,我每次安装这个 jar 时都必须回答“0 1 /tmp/log 1”并且我想自动化这个过程。
我尝试使用包含
的文件“answer.txt”0
1
/tmp/日志
1
使用命令:
java -jar foo.jar
但是,它不起作用。 我不是 jar 的所有者,我无法修改它。
有什么线索吗?
【问题讨论】:
-
我确实阅读了stackoverflow.com/questions/456636/… 并尝试了 java -jar foo.jar 0 1 /tmp/log 1 但它也不起作用......