public static void debugExec(String[] command)
        throws IOException
    {
        Process p = getRuntime().exec(command);

        InputStream stdout =
            p.getInputStream();
        InputStream stderr =
            p.getErrorStream();

        InputStreamReader isr =
            new InputStreamReader(stdout);
        InputStreamReader isrErr =
            new InputStreamReader(stderr);

        BufferedReader br =
            new BufferedReader(isr);
        BufferedReader brErr =
            new BufferedReader(isrErr);

        System.err.println("---output trace---");
        String line = null;
        do {
            try {
                line = br.readLine();
                if(line != null) {
                    System.err.println("1> " + line);
                }
            }
            catch(IOException e) {
                System.err.println("---" + e + "---");
                line = null;
            }
        } while(line != null);
        do {
            try {
                line = brErr.readLine();
                if(line != null) {
                    System.err.println("2> " + line);
                }
            }
            catch(IOException e) {
                System.err.println("---" + e + "---");
                line = null;
            }
        } while(line != null);

        try {
            if (p.waitFor() != 0) {
                System.err.println("---exit value=" + p.exitValue() + "---");
            }
        }
        catch (InterruptedException e) {
            System.err.println(e);
        }
    }