private static void setupCommandLine(GeneralCommandLine commandLine, SimpleJavaParameters javaParameters) throws CantRunException {
    LocalTargetEnvironmentRequest request = new LocalTargetEnvironmentRequest();
    JdkCommandLineSetup setup = new JdkCommandLineSetup(request);
    setup.setupCommandLine(javaParameters);

    LocalTargetEnvironment environment;
    try {
      environment = request.prepareEnvironment(TargetProgressIndicator.EMPTY);
    }
    catch (ExecutionException e) {
      throw new CantRunException(e.getMessage(), e);
    }
    GeneralCommandLine generalCommandLine = environment.createGeneralCommandLine(setup.getCommandLine().build());
    commandLine.withParentEnvironmentType(javaParameters.isPassParentEnvs() ? ParentEnvironmentType.CONSOLE : ParentEnvironmentType.NONE);
    commandLine.getParametersList().addAll(generalCommandLine.getParametersList().getList());
    commandLine.getEnvironment().putAll(generalCommandLine.getEnvironment());
  }
private static void setupCommandLine(GeneralCommandLine commandLine, SimpleJavaParameters javaParameters)