private List<String> validateAndPrepareCommandLineForLocalRun() throws ExecutionException {
    if (myWorkingDirectory != null && !Files.isDirectory(myWorkingDirectory)) {
      LOG.debug("Invalid working directory: " + myWorkingDirectory);
      throw new WorkingDirectoryNotFoundException(myWorkingDirectory);
    }

    if (myExePath == null || myExePath.isBlank()) {
      LOG.debug("Invalid executable: " + myExePath);
      throw new ExecutionException(IdeUtilIoBundle.message("run.configuration.error.executable.not.specified"));
    }

    for (var entry : myEnvParams.entrySet()) {
      String name = entry.getKey(), value = entry.getValue();
      if (!EnvironmentUtil.isValidName(name)) throw new IllegalEnvVarException(IdeUtilIoBundle.message("run.configuration.invalid.env.name", name));
      if (!EnvironmentUtil.isValidValue(value)) throw new IllegalEnvVarException(IdeUtilIoBundle.message("run.configuration.invalid.env.value", name, value));
    }

    String exePath = myExePath;
    if (exePath.indexOf(File.separatorChar) == -1) {
      String lookupPath = myEnvParams.get("PATH");
      if (lookupPath == null && myParentEnvironmentType == ParentEnvironmentType.CONSOLE && SystemInfo.isMac) {
        String shellPath = EnvironmentUtil.getValue("PATH");
        if (!Objects.equals(shellPath, System.getenv("PATH"))) {
          lookupPath = shellPath;
        }
      }
      if (lookupPath != null) {
        File exeFile = PathEnvironmentVariableUtil.findInPath(myExePath, lookupPath, null);
        if (exeFile != null) {
          LOG.debug(exePath + " => " + exeFile);
          exePath = exeFile.getPath();
        }
      }
    }

    return prepareCommandLine(exePath, myProgramParams.getList(), Platform.current());
  }
private List<String> validateAndPrepareCommandLineForLocalRun()