如题报错,“process = Runtime.getRuntime().exec(execString);”这一句报的。帮忙看看是什么问题?代码如下:
[code="java"]
private String processExcelMacro(String processingProgramPath,
String fileName, String excelMacroName)
throws ProcessCommandException {
PropertyConfigurator.configure("log4j.properties");
String execString = processingProgramPath + " \"" + fileName + "\" "
+ excelMacroName;
java.lang.Process process = null;
try {
process = Runtime.getRuntime().exec(execString);
logger.debug("Process Command :" + execString);
process.waitFor();
process.destroy();
return getProcessReturnString(process.getInputStream(),
process.getErrorStream());
} catch (Throwable ex) {
logger.error("ExcelMacroProgramInvoke.processFileByName|Do \""
+ execString + "\" Error|Error Message:" + ex);
throw new ProcessCommandException(ex);
} finally {
if (process != null) {
process.destroy();
}
}
}
[/code]
IOException CreateProcess error=21
- 写回答
- 好问题 0 提建议
- 追加酬金
- 关注问题
- 邀请回答
-
3条回答 默认 最新
- redstarofsleep 2011-05-11 09:17关注
是不是文件没找到呀?路径有问题
本回答被题主选为最佳回答 , 对您是否有帮助呢?解决 无用评论 打赏 举报