Hi there,
I am trying to use the Runtime.exec() to call another
Java program, like this way:
Runtime runtime = Runtime.getRuntime();
Process process = null;
try{
process = runtime.exec("java mypackage.MyProgram");
}catch(Throwable t){
t.printStackTrace();
}
......
process.waitFor();
int exitValue = process.exitValue();
But MyProgram does not get executed, and the exitValue = 1
Can anyone tell me what does the exitValue = 1 mean? What's wrong with my code?
Thanks a lot.
Mike