Runtime.getRuntime().exec()执行linuxshell脚本

来源:互联网 发布:淘宝网成交量 编辑:程序博客网 时间:2024/05/29 03:42

linux下:

String[] command = { "/bin/sh", "-c", cmmd };

Process ps = Runtime.getRuntime().exec(command );



windows下: 

String[] command = { "cmd", "/c", cmmd };

Process ps = Runtime.getRuntime().exec(command );

原创粉丝点击