先写一个shell,java代码里调用shell:String shellPath="123.sh"; Processprocess = Runtime.getRuntime().exec("./"+shellPath);