How to run a .jar file from inside another java program?

前端 未结 4 870
时光说笑
时光说笑 2021-01-22 04:44

i have a .jar file, which I can run on the command line:

java -jar myFile.jar argument1

I want to save the output of this .jar as a String vari

4条回答
  •  醉酒成梦
    2021-01-22 05:28

    Being a Jar file, you can add it to your class path and call the functionality of the program your self. You might need to know more about the logic behind the Jar to use it without having it output the information..

    I believe what you are looking for is how to shell execute the Jar archive. An example can be found here.

提交回复
热议问题