public static void exec(String[] cmd, Log log) throws ExecException {
		BufferedReader is = null;
		try {
			if (WINDOWS_OS) {
				for (int i = 0; i < cmd.length; i++) {
					cmd[i] = cmd[i].replaceAll("/", "\\\\");
				}
			}
			Process p = Runtime.getRuntime().exec(cmd);
			is = new BufferedReader(new InputStreamReader(p.getErrorStream()));
			String line;
			int errLine = -1;
			Pattern pattern = Pattern.compile(":\\d+:");
			while ((line = is.readLine()) != null) {
				log.append(line);
				Matcher matcher = pattern.matcher(line);
				if (matcher.find()) {
					errLine = Integer.valueOf(
							line.substring(matcher.start() + 1, matcher.end() - 1))
							.intValue();
					break;
				}
			}
			is.close();
			p.waitFor();
			if (errLine != -1) {
				StringBuffer sb = new StringBuffer(Messages.getString("Util.exec.failed"));
				AppendCommandLine(sb, cmd);
				throw new ExecException(sb.toString(), errLine);
			}
			if (p.exitValue() != 0) {
				StringBuffer sb = new StringBuffer(Messages.getString("Util.exec.failed"));
				sb.append(" (");
				sb.append(p.exitValue());
				sb.append(')');
				AppendCommandLine(sb, cmd);
				throw new ExecException(sb.toString());
			}
		} catch (IOException e) {
			close(is);
			throw new ExecException(e);
		} catch (InterruptedException e) {
			close(is);
			throw new ExecException(e);
		}
	}