public static Process exec(String... cmds) {
		if (ArrayUtil.isEmpty(cmds)) {
			throw new NullPointerException("Command is empty !");
		}

		// 单条命令的情况
		if (1 == cmds.length) {
			final String cmd = cmds[0];
			if (StrUtil.isBlank(cmd)) {
				throw new NullPointerException("Command is empty !");
			}
			cmds = StrUtil.splitToArray(cmd, StrUtil.C_SPACE);
		}

		Process process;
		try {
			process = new ProcessBuilder(cmds).redirectErrorStream(true).start();
		} catch (IOException e) {
			throw new IORuntimeException(e);
		}
		return process;
	}
public static Process exec ( String ... cmds ) { if ( ArrayUtil . isEmpty ( cmds ) ) { throw new NullPointerException ( "Command is empty !" ) ; } if ( 1 == cmds . length ) { final String cmd = cmds [ 0 ] ; if ( StrUtil . isBlank ( cmd ) ) { throw new NullPointerException ( "Command is empty !" ) ; } cmds = StrUtil . splitToArray ( cmd , StrUtil . C_SPACE ) ; } Process process ; try { process = new ProcessBuilder ( cmds ) . redirectErrorStream ( true ) . start ( ) ; } catch ( IOException e ) { throw new IORuntimeException ( e ) ; } return process ; }
执行命令<br>
命令带参数时参数可作为其中一个参数，也可以将命令和参数组合为一个字符串传入

@param cmds 命令
@return {@link Process}