Running a .exe file using Java

前端 未结 4 1607
既然无缘
既然无缘 2020-12-06 15:45

How to run an exe file using java code?The .exe file is already there. The plan is to write a Java code for running the same. Any tutorial or reference for the same?

4条回答
  •  醉酒成梦
    2020-12-06 16:17

    You need to execute exec() method of Runtime that returns Process instance or use ProcessBuilder class methods.

    Process process=Runtime.getRuntime().exec("file.exe");
    

提交回复
热议问题