⑴ java如何調用exe文件
public class transferExe {x0dx0a public static void main(String[] args) {x0dx0a openWinExe();x0dx0a openExe();x0dx0a }x0dx0a //爛前蔽用 Java 調用windows系統的exe文飢州件,比如notepad,calc之類x0dx0a public static void openWinExe() {x0dx0a Runtime rn = Runtime.getRuntime();x0dx0a Process p = null;x0dx0a try {x0dx0a String command = "notepad";x0dx0a p = rn.exec(command);x0dx0a } catch (Exception e) {x0dx0a System.out.println("Error win exec!");x0dx0a }x0dx0a }x0dx0a //調用悔寬其他的可執行文件,例如:自己製作的exe,或是 下載 安裝的軟體.x0dx0a public static void openExe() {x0dx0a Runtime rn = Runtime.getRuntime();x0dx0a Process p = null;x0dx0a try {x0dx0a p = rn.exec("\"D:/QQ2010.exe\"");x0dx0a } catch (Exception e) {x0dx0a System.out.println("Error exec!");x0dx0a }x0dx0a }x0dx0a }