通过Runtime.getRuntime().exec(String [] commands)来执行,比如Runtime.getRuntime().exec("/usr/local/b.sh");前提是你的shell脚本已经有执行权限,如没有,可以执行("sh /usr/local/b.sh")