I use process.waitFor to wait for a external tool (CADD, a computational biology tool) to do some calculation under RHEL 6.6
String cmdStr = "CADD_v1.3/bin/score.sh input.vcf.gz output.vcf.gz"
try {
Process p;
p = Runtime.getRuntime().exec(cmdStr);
int exitVal = p.waitFor();
System.out.println("complete. Return value " + exitVal);
} catch (Exception e) {
e.printStackTrace();
}
return;
The code print complete immediately without waiting. The exit value is 0. and the calculation doesn't even go to the end (it is initiated since the output.vcf.gz is created, but the output file is always empty).
The cmdStr itself runs OK in terminal.
Suggestions are appreciated. Thanks