public class ExecuteFile { public static void main(String[] args){ String f="../MyApp/phone.txt"; //绝对路径:E:/我的文档/我的文档/java/MyApp/phone.txt //注意是'/'而不是'\' try{ Runtime r=Runtime.getRuntime(); r.exec("cmd /c start"+f); }catch(Exception e){} } }