I have a jar file. I am running this jar file by creating a process. So, what is the difference between running it through command prompt
without creating a process? Will it affect the application's performance?
Asked
Active
Viewed 38 times
0

David Oliván
- 2,717
- 1
- 19
- 26

ganesh
- 43
- 6
-
1Could you please explain,what do you mean by creating a process? – Ankit Tripathi Sep 16 '16 at 06:41
-
Process gateProcess = Runtime.getRuntime().exec(command); so here I am running external jar by creating a process – ganesh Sep 16 '16 at 06:46
1 Answers
0
If your application requires you to run the jar file as a command in a separate process from your java application,It's the way to go.There is no question of performance.
However when you launch command prompt through Runtime.exec()
,command line will be executed as a sub-process or a separate process in a random layer.
I'd rather recommend you to use ProcessBuilder,however it's a different topic.
For difference between Runtime.exec()
and ProcessBulilder please go through this

Community
- 1
- 1

Ankit Tripathi
- 405
- 4
- 13