FileSystemView systemView = FileSystemView.getFileSystemView();
File homeDirectory = systemView.getHomeDirectory();
//桌面路径
String path = homeDirectory.getPath();
String fileLocation = path +"\\"+ "操作日志.xlsx";
FileOutputStream outputStream = new FileOutputStream(fileLocation);
workbook.write(outputStream);
workbook.close();
windows环境导出excel好用,部署到linux不好使。保存到桌面上的