你的命令行不对?
我的机器上可以执行
import java.io.*;public class errout {
  public static void main(String[] args) {
    Process listmgr;
    DataInputStream addResult;
    int BUFFER_SIZE = 1000;
    int byteCount = -1;    String s = new String("cmd dir");
//    for (int i = 0; i < args.length; i++)
//           s = s + " " + args[i];
      try{
        listmgr = Runtime.getRuntime().exec(s);
        addResult = new DataInputStream(
            new BufferedInputStream(listmgr.getInputStream()));
        byte[] resultBuf = new byte[BUFFER_SIZE];
        byteCount = addResult.read(resultBuf);
        if (byteCount != -1) {
          String result = new String(resultBuf).trim();
          System.out.print(result);
        }
        else
          System.out.println("No Data");
      }
      catch(IOException e){e.printStackTrace();}
   }
  }