public static void executeConfiguration(
      @NotNull Project project,
      @NotNull RunnerAndConfigurationSettings configuration,
      @NotNull Executor executor) {
    ExecutionEnvironmentBuilder builder;
    try {
      builder = ExecutionEnvironmentBuilder.create(executor, configuration);
    } catch (ExecutionException e) {
      LOG.error(e);
      return;
    }

    executeConfiguration(
        builder.contentToReuse(null).dataContext(null).activeTarget().build(), true, true);
  }
 @Override
 public void restartRunProfile(
     @NotNull Project project,
     @NotNull Executor executor,
     @NotNull ExecutionTarget target,
     @Nullable RunnerAndConfigurationSettings configuration,
     @Nullable ProcessHandler processHandler) {
   ExecutionEnvironmentBuilder builder =
       createEnvironmentBuilder(project, executor, configuration);
   if (processHandler != null) {
     for (RunContentDescriptor descriptor : getContentManager().getAllDescriptors()) {
       if (descriptor.getProcessHandler() == processHandler) {
         builder.contentToReuse(descriptor);
         break;
       }
     }
   }
   restartRunProfile(builder.target(target).build());
 }