0

I am having the java main application which needs to execute another jar file and return it without waiting for the jar execution complete. Is it possible to achieve it using Java. Can anyone give some inputs in it.

Soorya Prakash
  • 921
  • 3
  • 9
  • 29

1 Answers1

1

Do following:

Runtime.getRuntime().exec("java -jar <PATH_OF _JAR>");

in your Main class.

And as @Yoav has suggested. You need to take care of errors by adopting proper error handling strategy.

Do Read - https://www.tutorialspoint.com/java/lang/runtime_exec.htm

Pramod S. Nikam
  • 4,271
  • 4
  • 38
  • 62