8

Similar question related to Batch script has an answer. But I need same in shell script.

0

1 Answer 1

15

Just launch your jar adding a & at the end Example :

#!/bin/bash

java -jar myjar1.jar &
java -jar myjar2.jar &
java -jar myjar3.jar &

If you want the jar keep running after closing the terminal, use nohup :

#!/bin/bash

nohup java -jar myjar1.jar &
nohup java -jar myjar2.jar &
nohup java -jar myjar3.jar &

I use it in a project, works like a charm.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.