Runtime.exec with a third argument (current working directory argument) that
refers to a nonexistant directory can cause the child process to hang. This
is on Solaris 8 w/ 1.4.2-b18.
The following testcase will hang waiting for the hung child process:
import java.io.*;
public class FAEBug {
public static void main(String args[]) {
try {
Process p = Runtime.getRuntime().exec("/usr/bin/ls",
null,
new File("foo"));
p.waitFor();
} catch (Exception e) {
e.printStackTrace();
}
}
}
See also comments.
refers to a nonexistant directory can cause the child process to hang. This
is on Solaris 8 w/ 1.4.2-b18.
The following testcase will hang waiting for the hung child process:
import java.io.*;
public class FAEBug {
public static void main(String args[]) {
try {
Process p = Runtime.getRuntime().exec("/usr/bin/ls",
null,
new File("foo"));
p.waitFor();
} catch (Exception e) {
e.printStackTrace();
}
}
}
See also comments.
- duplicates
-
JDK-4811767 (process) Runtime.exec should throw IOException when workdir does not exist (Unix)
-
- Resolved
-
- relates to
-
JDK-4823901 HotSpor Virtual Machine Error: 11
-
- Closed
-