private SimpleJavaParameters createJavaParameters() throws ExecutionException {
    final Sdk jdk = myXsltRunConfiguration.getEffectiveJDK();
    if (jdk == null) {
      throw CantRunException.noJdkConfigured();
    }

    final SimpleJavaParameters parameters = new SimpleJavaParameters();
    parameters.setJdk(jdk);

    if (myXsltRunConfiguration.getJdkChoice() == XsltRunConfiguration.JdkChoice.FROM_MODULE) {
      final Module module = myXsltRunConfiguration.getEffectiveModule();
      // relaxed check for valid module: when running XSLTs that don't belong to any module, let's assume it is
      // OK to run as if just a JDK has been selected (a missing JDK would already have been complained about above)
      if (module != null) {
        OrderEnumerator.orderEntries(module).productionOnly().recursively().classes().collectPaths(parameters.getClassPath());
      }
    }

    final ParametersList vmParameters = parameters.getVMParametersList();
    vmParameters.addParametersString(myXsltRunConfiguration.myVmArguments);
    if (XsltRunConfiguration.isEmpty(myXsltRunConfiguration.getXsltFile())) {
      throw new CantRunException(XPathBundle.message("dialog.message.no.xslt.file.selected"));
    }
    vmParameters.defineProperty("xslt.file", myXsltRunConfiguration.getXsltFile());
    if (XsltRunConfiguration.isEmpty(myXsltRunConfiguration.getXmlInputFile())) {
      throw new CantRunException(XPathBundle.message("dialog.message.no.xml.input.file.selected"));
    }
    vmParameters.defineProperty("xslt.input", myXsltRunConfiguration.getXmlInputFile());

    final XsltRunConfiguration.OutputType outputType = myXsltRunConfiguration.getOutputType();
    if (outputType == XsltRunConfiguration.OutputType.CONSOLE) {
      //noinspection deprecation
      myPort = NetUtils.tryToFindAvailableSocketPort(myXsltRunConfiguration.myRunnerPort);
      vmParameters.defineProperty("xslt.listen-port", String.valueOf(myPort));
    }
    if (myXsltRunConfiguration.isSaveToFile()) {
      vmParameters.defineProperty("xslt.output", myXsltRunConfiguration.myOutputFile);
    }

    for (Pair<String, String> pair : myXsltRunConfiguration.getParameters()) {
      final String name = pair.getFirst();
      final String value = pair.getSecond();
      if (XsltRunConfiguration.isEmpty(name) || value == null) continue;
      vmParameters.defineProperty("xslt.param." + name, value);
    }
    vmParameters.defineProperty("xslt.smart-error-handling", String.valueOf(myXsltRunConfiguration.mySmartErrorHandling));

    PluginDescriptor plugin = PluginManager.getPluginByClass(getClass());
    if (plugin != null) {
      Path rtPath = plugin.getPluginPath().resolve("lib/rt/xslt-rt.jar");
      if (!Files.exists(rtPath)) {
        throw new CantRunException(XPathBundle.message("dialog.message.runtime.classes.not.found.at", rtPath));
      }
      parameters.getClassPath().addTail(rtPath.toAbsolutePath().toString());
    }
    else {
      String rtPath = PathManager.getJarPathForClass(XSLTMain.class);
      if (rtPath == null) {
        throw new CantRunException(XPathBundle.message("dialog.message.cannot.find.runtime.classes.on.classpath"));
      }
      parameters.getClassPath().addTail(rtPath);
      parameters.getVMParametersList().prepend("-ea");
    }

    parameters.setMainClass("org.intellij.plugins.xslt.run.rt.XSLTRunner");

    if (XsltRunConfiguration.isEmpty(myXsltRunConfiguration.myWorkingDirectory)) {
      parameters.setWorkingDirectory(new File(myXsltRunConfiguration.getXsltFile()).getParentFile());
    }
    else {
      parameters.setWorkingDirectory(expandPath(myXsltRunConfiguration.myWorkingDirectory, myXsltRunConfiguration.getEffectiveModule(),
                                                myXsltRunConfiguration.getProject()));
    }

    myExtensionData = new UserDataHolderBase();
    final List<XsltRunnerExtension> extensions = XsltRunnerExtension.getExtensions(myXsltRunConfiguration, myIsDebugger);
    for (XsltRunnerExtension extension : extensions) {
      extension.patchParameters(parameters, myXsltRunConfiguration, myExtensionData);
    }

    parameters.setUseDynamicClasspath(myXsltRunConfiguration.getProject());

    return parameters;
  }
private SimpleJavaParameters createJavaParameters()