//这样写支持命令中的管道符 Process ps = Runtime.getRuntime().exec(new String[]{ "/bin/sh", "-c", "ps -ef | java" });