缺点会牺牲跨平台特性,必须每个系统找到对应的执行命令
browserPath 程序路径 例:浏览器IE8
htmlFileName HTML文件全路径
ProcessBuilder builder = new ProcessBuilder(browserPath, htmlFileName);
try {
builder.start();
} catch (IOException e) {
String errorMsg = "can't start the browser";
logger.error(errorMsg, e);
throw new ServiceException(errorMsg, e);
}