您好,我有一个关于通过批处理文件在同一文件夹中运行多个 jar 文件的问题。 我需要创建一个循环并读取所有 jar 文件名称,然后运行它们,并为所有 jar 创建输出。 像这样的代码:
cls
cd\
cd C:\java\
set PATH=%PATH%;C:\Program Files\Java\jdk1.8.0_20\bin;
cls
javac -jar "here come the name from the folder"
jarname < input1+"the name of the jar".txt > output1+"the name of the jar".txt
最佳答案
怎么样:
for %%j in (*.jar) do (
java -jar "%%j" < "input%%~nj.txt" > "output%%~nj.txt"
)
关于java - 批量运行 30 个 jar 并保存每个 jar 的输出结果,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27533115/