@Override
  public void checkConfiguration() throws RuntimeConfigurationException {
    super.checkConfiguration();

    final String scriptPath = getScriptPath();

    final VirtualFile script = ScriptFileUtil.findScriptFileByPath(scriptPath);
    if (script == null) {
      throw new RuntimeConfigurationException(GroovyBundle.message("script.runner.cant.find.script", scriptPath));
    }

    final GroovyScriptRunner scriptRunner = getScriptRunner();
    if (scriptRunner == null) {
      throw new RuntimeConfigurationException(GroovyBundle.message("script.runner.unknown.script.type", scriptPath));
    }

    scriptRunner.ensureRunnerConfigured(this);

    final PsiFile file = PsiManager.getInstance(getProject()).findFile(script);
    final PsiClass toRun = GroovyRunnerPsiUtil.getRunningClass(file);
    if (toRun == null) {
      throw new RuntimeConfigurationWarning(GroovyBundle.message("script.runner.class.does.not.exist"));
    }
    if (toRun instanceof GrTypeDefinition) {
      if (!GroovyRunnerPsiUtil.canBeRunByGroovy(toRun)) {
        throw new RuntimeConfigurationWarning(GroovyBundle.message("script.runner.class.cannot.be.executed"));
      }
    }
    else {
      throw new RuntimeConfigurationWarning(GroovyBundle.message("script.runner.file.is.not.groovy.file"));
    }
    JavaParametersUtil.checkAlternativeJRE(this);
  }
@Override
  public void checkConfiguration()