--- old/test/java/lang/Runtime/exec/ExecWithInput.java 2014-02-24 21:03:28.984725111 +0400 +++ new/test/java/lang/Runtime/exec/ExecWithInput.java 2014-02-24 21:03:28.428725126 +0400 @@ -39,7 +39,8 @@ public class ExecWithInput { - private static final String CAT = "/bin/cat"; + static final boolean isLinux = + System.getProperty("os.name", "unknown").startsWith("Linux"); private static final int N = 200; static int go(int i) throws Exception { @@ -50,8 +51,7 @@ * program exits. Under 1.4.1, cat sometimes gets stuck on a pipe * read and never terminates. */ - //Process p = Runtime.getRuntime().exec(new String[] { CAT } ); - Process p = Runtime.getRuntime().exec(CAT); + Process p = Runtime.getRuntime().exec("cat"); String input = i + ": line 1\n" + i + ": line 2\n"; StringBufferInputStream in = new StringBufferInputStream(input); @@ -65,10 +65,8 @@ } public static void main(String[] args) throws Exception { - if (!System.getProperty("os.name").equals("Linux")) - return; - if (File.separatorChar == '\\') { - // no /bin/cat on windows + if (! isLinux) { + System.err.println("Only for Linux"); return; } for (int i = 0; i < N; i++)