class TEST
{
public static void main(String[] args){
System.out.println("Hello World!");
try{
Runtime.getRuntime().exec("cmd /c start D://A.xls");
}catch(IOException e){}
}
}
Runtime.getRuntime().exec("cmd /c start d://a.xls")
getRuntime()是取得系统运行时环境
start参数表名直接启动excel文件,相当于双击操作 ,是个windows命令.
引用博客:https://blog.csdn.net/aiwo429001/article/details/6406626