private static Sdk createAlternativeJdk(@NotNull Project project, @NotNull String jreHome) throws CantRunException {
    final Sdk configuredJdk = ProjectJdkTable.getInstance().findJdk(jreHome);
    if (configuredJdk != null) {
      return configuredJdk;
    }

    if (JdkUtil.checkForJre(jreHome)) {
      final JavaSdk javaSdk = JavaSdk.getInstance();
      return javaSdk.createJdk(ObjectUtils.notNull(javaSdk.getVersionString(jreHome), ""), jreHome);
    }

    UnknownAlternativeSdkResolver.getInstance(project).notifyUserToResolveJreAndFail(jreHome);
    throw new IllegalStateException();
  }
private static Sdk createAlternativeJdk(@NotNull Project project, @NotNull String jreHome)