简体   繁体   中英

Shell script to run multiple jar files

I have created three jar files (SSS_Infinite.jar, SSS_Lwindow.jar, SSS_LwindowExe.jar) as part of requirement. Need to design a shell script to run all three in a single one sequentially.

Can you please help on this, i dont find any help for executign multiple jar files in a single shell script.

Regards, Vidhya C

Try that:

x=`ls -l |awk '{print $NF}'|grep '.jar'`

for y in $x; do
java -jar $y
done

EDIT

The code below will run every jar file inside the directory that you're running.

 java -jar *.jar

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM