@Override
  public boolean validate(GradleProjectSettings settings) throws ConfigurationException {
    if (myGradleJdkComboBox != null && !ApplicationManager.getApplication().isUnitTestMode()) {
      SdkInfo sdkInfo = getSelectedGradleJvmInfo(myGradleJdkComboBox);
      if (sdkInfo instanceof SdkInfo.Undefined) {
        throw new ConfigurationException(GradleBundle.message("gradle.jvm.undefined"));
      }
      if (sdkInfo instanceof SdkInfo.Resolved) {
        String homePath = ((SdkInfo.Resolved)sdkInfo).getHomePath();
        if (!ExternalSystemJdkUtil.isValidJdk(homePath)) {
          throw new ConfigurationException(GradleBundle.message("gradle.jvm.incorrect", homePath));
        }
      }
    }

    if (myGradleHomePathField != null && getSelectedGradleDistribution() == DistributionType.LOCAL) {
      String gradleHomePath = FileUtil.toCanonicalPath(myGradleHomePathField.getText());
      if (StringUtil.isEmpty(gradleHomePath)) {
        myGradleHomeSettingType = LocationSettingType.UNKNOWN;
        throw new ConfigurationException(GradleBundle.message("gradle.home.setting.type.explicit.empty", gradleHomePath));
      }
      else if (!GradleInstallationManager.getInstance().isGradleSdkHome(myProjectRef.get(), new File(gradleHomePath))) {
        myGradleHomeSettingType = LocationSettingType.EXPLICIT_INCORRECT;
        new DelayedBalloonInfo(MessageType.ERROR, myGradleHomeSettingType, 0).run();
        throw new ConfigurationException(GradleBundle.message("gradle.home.setting.type.explicit.incorrect", gradleHomePath));
      }
    }
    return true;
  }
@Override
  public boolean validate(GradleProjectSettings settings)