java调用exe的几种方法
Runtime rt = Runtime.getRuntime();
try
{
java.awt.Desktop.getDesktop().open(new File("E:\\XML2XLS\\circlegrid.exe"));
//rt.exec("E:\\XML2XLS\\circlegrid.exe");
//rt.exec(new String[]{"cmd","/c","E:\\XML2XLS\\circlegrid.exe"});
//rt.exec("\"E:\\XML2XLS\\circlegrid.exe\"");
//rt.exec("cmd /c E:\\XML2XLS\\circlegrid.exe \f"); // \f前面有没有空格一样,去掉\f也没有影响,cmd
}
catch (IOException e)
{
e.printStackTrace();
}