code: public static File find(String executable, File... dirs) {
          // First try using the hints.
          if (dirs != null) {
              for (File hint : dirs) {
                  File file = findExecutableInDirectory(executable, hint);
                  if (file != null) {
                      return file;
                  }
              }
          }
  
          // Not found, try to use the system path.
          return findExecutableInSystemPath(executable);
      }
docs: Tries to find an executable with the given name. It first checks in of the given directories (if any) and
  then tries in the system's path. The lookup tries several extensions (.sh, .bash, .exe. .cmd. and .bat).
  
  @param executable the name of the program to find, generally without the extension
  @param dirs       optional set of directories in which the program need to be searched before checking the system's
  path.
  @return the executable's file, {@code null} if not found