Running a .exe file using Java
问题 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? 回答1: Try the following code: try { Runtime rt = Runtime.getRuntime() ; Process p = rt.exec("Program.exe") ; InputStream in = p.getInputStream() ; OutputStream out = p.getOutputStream (); InputStream err = p.getErrorStream() ; //do whatever you want p.destroy() ; } catch(Exception exc) { /*handle exception*/ } 回答2: You need to