81,122
社区成员




public class Open {
public static void main(String[] args) throws Exception {
//打开本地程序文件方式1
Runtime rt = Runtime.getRuntime();
String fileLac = "D:\\HBuilder\\HBuilder.exe";
rt.exec(fileLac);
//打开本地程序文件方式2
Desktop desktop = Desktop.getDesktop();
File file = new File("C:/Windows/System32\cmd.exe");
desktop.open(file);
//打开本地网站,默认浏览器打开
URI uriNet = new URI("www.baidu.com");
Desktop.getDesktop().browse(uriNet);
}
}
Runtime.getRuntime().exec("cmd /c start D:/mylocal/测试用例.xls");