0
我试图执行'jmap -dump:format = b;在的Runtime.exec()文件”命令,但它不会执行操作中,如日期等命令,PWD工作正常。 谁能知道为什么?JMAP转储没有在java执行:runtime.exec()
公共静态无效的命令(String s)将 {
runtime=Runtime.getRuntime();
try {
System.out.println(" Creating Heap Dump ");
process=runtime.exec("jmap -dump:format=b,file=D:/heapdump_2012APR10/heapdump_date +%d%b%Y-%H_%M_%S.bin 4478");
System.out.println("Heap Dump Created. Zipping the file");
process=runtime.exec("gzip *.bin");
System.out.println("Succesfully zipped");
} catch (Exception e) {
e.printStackTrace();
}
}
显示您用来调用它的代码。 – 2012-04-15 07:56:49
解决方法可能是通过执行***所有*** [Runtime.exec()不会]时的建议(http://www.javaworld.com/javaworld/jw-12-2000/ JW-1229-traps.html)。 – 2012-04-15 08:25:15
现在添加的代码.. – Loga 2012-04-16 03:39:29