i have tried to execute the 'jmap -dump:format =b; file" command in runtime.exec(), but it wont execute where other commands like date, pwd are working fine. can anyone know why?
public static void commands(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();
}
}