第一种
String nowPath="C:\\Program Files\\Microsoft Office\\Office15\\xx.html";
try {
Runtime.getRuntime().exec("C:\\Program Files\\Microsoft Office\\Office15\\WINWORD.EXE "+nowPath);
} catch (IOException e) {
e.printStackTrace();
}
第二种
将word的路径加载系统变量中
String[] cmd = new String[5];
cmd[0] = "cmd";
cmd[1] = "/c";
cmd[2] = "winword";
cmd[3] = " ";
cmd[4] = outputUrl;
Runtime.getRuntime().exec(cmd);
} catch (IOException e) {
e.printStackTrace();
}