package filerun; import java.io.File; import java.io.IOException; public class RunExe { public static void main(String[] args) { // TODO Auto-generated method stub Runtime run = Runtime.getRuntime(); File f = new File("E:\QQMusic","QQMusic.exe"); System.out.println(f.getAbsolutePath()); try { run.exec(f.getAbsolutePath()); System.out.println("运行成功"); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } } }