private static void handleProcessNotStartedError(@NotNull ConfigurationWithCommandLineShortener configuration,
                                                   @NotNull ProcessNotCreatedException e,
                                                   String name,
                                                   String windowId,
                                                   @NotNull ExecutionEnvironment environment) {
    String description = e.getMessage();
    HyperlinkListener listener = null;
    Project project = configuration.getProject();
    RunManager runManager = RunManager.getInstance(project);
    RunnerAndConfigurationSettings runnerAndConfigurationSettings = ContainerUtil.find(runManager.getAllSettings(), settings -> settings.getConfiguration() == configuration);
    if (runnerAndConfigurationSettings != null && noShortenerConfigured(configuration)) {
      ConfigurationFactory factory = runnerAndConfigurationSettings.getFactory();
      RunnerAndConfigurationSettings configurationTemplate = runManager.getConfigurationTemplate(factory);
      ConfigurationWithCommandLineShortener templateConfiguration = (ConfigurationWithCommandLineShortener)configurationTemplate.getConfiguration();
      description = ExecutionBundle.message("dialog.message.command.line.too.long", name);
      
      String exePath = e.getCommandLine().getExePath();
      JdkVersionDetector.JdkVersionInfo jdkVersionInfo = JdkVersionDetector.getInstance().detectJdkVersionInfo(new File(exePath).getParentFile().getParent());
      if (jdkVersionInfo != null) {
        description += "<br/>";
        description += ExecutionBundle.message(jdkVersionInfo.version.feature >= 9 ? "dialog.message.command.line.too.long.java9" 
                                                                                   : "dialog.message.command.line.too.long.java8");
      }

      listener = event -> {
        if (event.getEventType() == HyperlinkEvent.EventType.ACTIVATED) {
          String eventDescription = event.getDescription();
          if ("edit".equals(eventDescription)) {
            RunDialog.editConfiguration(project, 
                                        runnerAndConfigurationSettings, 
                                        ExecutionBundle.message("edit.run.configuration.for.item.dialog.title", name));
          }
          else if (eventDescription != null) {
            ShortenCommandLine shortener = getShortenerFromLink(eventDescription);
            if (shortener != null) {
              configuration.setShortenCommandLine(shortener);
              if (noShortenerConfigured(templateConfiguration)) {
                templateConfiguration.setShortenCommandLine(shortener);
              }
            }
            ExecutionUtil.restart(environment);
          }
        }
      };
    }
    ExecutionUtil.handleExecutionError(project, windowId, e, ExecutionBundle.message("error.running.configuration.message", name), description, Function.identity(), listener);
  }
private static void handleProcessNotStartedError(@NotNull ConfigurationWithCommandLineShortener configuration,
                                                   @NotNull ProcessNotCreatedException e,
                                                   String name,
                                                   String windowId,
                                                   @NotNull ExecutionEnvironment environment)