code: public static String executeProcess(Map<String, String> env, File workingFolder, String... command) throws ProcessException, InterruptedException {
          ProcessBuilder pb = new ProcessBuilder(command);
          if (workingFolder != null) {
              pb.directory(workingFolder);
          }
          if (env != null) {
              pb.environment().clear();
              pb.environment().putAll(env);
          }
          pb.redirectErrorStream(true);
          int code;
          try {
              Process process = pb.start();
              String payload;
              try {
                  code = process.waitFor();
              } catch (InterruptedException ex) {
                  process.destroy();
                  throw ex;
              }
              payload = Miscellaneous.toString(process.getInputStream(), "UTF-8");
              if (code == 0) {
                  return payload;
              } else {
                  StringBuilder sb = new StringBuilder("Process returned code: " + code + ".");
                  if (payload != null) {
                      sb.append("\n").append(payload);
                  }
                  throw new ProcessException(code, sb.toString());
              }
          } catch (IOException ex) {
              throw new RuntimeException(ex);
          }
  
      }
docs: Executes a native process with small stdout and stderr payloads
  
  @param env
  @param workingFolder
  @param command
  @return Merged stderr and stdout
  @throws ProcessException if process ret code is not 0
  @throws InterruptedException