private static String getJdkExecPath(@NotNull ApplicationConfiguration applicationConfiguration) {
    Project project = applicationConfiguration.getProject();
    try {
      Sdk jdk = JavaParametersUtil.createProjectJdk(project, applicationConfiguration.getAlternativeJrePath());
      if (jdk == null) {
        throw new RuntimeException(ExecutionBundle.message("run.configuration.error.no.jdk.specified"));
      }

      SdkTypeId type = jdk.getSdkType();
      if (!(type instanceof JavaSdkType)) {
        throw new RuntimeException(ExecutionBundle.message("run.configuration.error.no.jdk.specified"));
      }

      return ((JavaSdkType)type).getVMExecutablePath(jdk);
    }
    catch (CantRunException e) {
      ExecutionErrorDialog.show(e, RunnerBundle.message("dialog.title.cannot.use.specified.jre"), project);
    }
    return null;
  }
private static String getJdkExecPath(@NotNull ApplicationConfiguration applicationConfiguration)