Create the environment array for executing via {@link Runtime}.
16494
private static String[] createEnvironmentArray(final Map<String, String> envMap) {
        final ArrayList<String> envlist = new ArrayList<String>();
        for (final Map.Entry<String, String> entry : envMap.entrySet()) {
            envlist.add(entry.getKey() + "=" + entry.getValue());
        }
        return envlist.toArray(new String[envlist.size()]);
    }
286406
private JavacEnvironment createEnvironment(List<File> files, List<JavaFileObject> fileObjects,
      boolean processAnnotations) throws IOException {
    JavaCompiler compiler = ToolProvider.getSystemJavaCompiler();
    DiagnosticCollector<JavaFileObject> diagnostics = new DiagnosticCollector<>();
    StandardJavaFileManager fileManager = getFileManager(compiler, diagnostics);
    List<String> javacOptions = getJavacOptions(processAnnotations);
    if (fileObjects == null) {
      fileObjects = new ArrayList<>();
    }
    for (JavaFileObject jfo : fileManager.getJavaFileObjectsFromFiles(files)) {
      fileObjects.add(filterJavaFileObject(jfo));
    }
    JavacTask task = (JavacTask) compiler.getTask(null, fileManager, diagnostics,
        javacOptions, null, fileObjects);
    return new JavacEnvironment(task, fileManager, diagnostics);
  }
705765
async def Runtime(args, env):
    ''
    r = _Runtime(args, env)
    await r._init_cache()
    return r
604722
private Properties getEnvironmentVariables() throws Throwable {
		Properties environmentVariables = new Properties();
		String operatingSystem = System.getProperty("os.name").toLowerCase();
		Runtime runtime = Runtime.getRuntime();
		Process process = null;
		if (operatingSystem.startsWith("windows 95")
				|| operatingSystem.startsWith("windows 98")
				|| operatingSystem.startsWith("me")) {
			process = runtime.exec("command.com /c set");
		} else if (operatingSystem.startsWith("windows")) {
			// Modern windows
			process = runtime.exec("cmd.exe /c set");
		} else {
			process = runtime.exec("env");
		}
		BufferedReader environmentStream = new BufferedReader(new InputStreamReader(process.getInputStream()));
		String inputLine = "";
		int idx = -1;
		while ((inputLine = environmentStream.readLine()) != null) {
			idx = inputLine.indexOf('=');
			environmentVariables.setProperty(inputLine.substring(0, idx),
					inputLine.substring(idx + 1));
		}
		return environmentVariables;
	}
696696
private void setAsContext() {
		ExecutionEnvironmentFactory factory = new ExecutionEnvironmentFactory() {

			@Override
			public ExecutionEnvironment createExecutionEnvironment() {
				return OptimizerPlanEnvironment.this;
			}
		};
		initializeContextEnvironment(factory);
	}
1134483
public static synchronized void initializeEnvironment()
  {
    if (_isStaticInit)
      return;

    _isStaticInit = true;

    ClassLoader systemLoader = ClassLoader.getSystemClassLoader();

    Thread thread = Thread.currentThread();
    ClassLoader oldLoader = thread.getContextClassLoader();
    try {
      thread.setContextClassLoader(systemLoader);
      
      if ("1.8.".compareTo(System.getProperty("java.runtime.version")) > 0)
        throw new ConfigException("Baratine requires JDK 1.8 or later");

      // #2281
      // PolicyImpl.init();

      //EnvironmentStream.setStdout(System.out);
      //EnvironmentStream.setStderr(System.err);

      /*
      try {
        Vfs.initJNI();
      } catch (Throwable e) {
      }
      */
      
      Properties props = System.getProperties();

      ClassLoader envClassLoader
        = EnvironmentClassLoader.class.getClassLoader();

      /*
      boolean isGlobalLoadableJndi = false;
      try {
        Class<?> cl = Class.forName("com.caucho.v5.naming.InitialContextFactoryImpl",
                                    false,
                                    systemLoader);

        isGlobalLoadableJndi = (cl != null);
      } catch (Exception e) {
        log().log(Level.FINER, e.toString(), e);
      }
      
      // #3486
      String namingPkgs = (String) props.get("java.naming.factory.url.pkgs");
      if (namingPkgs == null)
        namingPkgs = "com.caucho.v5.naming";
      else
        namingPkgs = namingPkgs + ":" + "com.caucho.v5.naming";
      props.put("java.naming.factory.url.pkgs", namingPkgs);

      if (isGlobalLoadableJndi) {
        // These properties require the server to be at the system loader

        if (props.get("java.naming.factory.initial") == null) {
          props.put("java.naming.factory.initial",
                    "com.caucho.v5.naming.InitialContextFactoryImpl");
        }
      }
      */

      /*
      boolean isGlobalLoadableJmx = false;
      try {
        Class<?> cl = Class.forName("com.caucho.v5.jmx.MBeanServerBuilderImpl",
                                    false,
                                    systemLoader);

        isGlobalLoadableJmx = (cl != null);
      } catch (Exception e) {
        log().log(Level.FINER, e.toString(), e);
      }
      
      if (isGlobalLoadableJmx) {
        // props.put("java.naming.factory.url.pkgs", "com.caucho.naming");

        EnvironmentProperties.enableEnvironmentSystemProperties(true);

        String oldBuilder = props.getProperty("javax.management.builder.initial");
        if (oldBuilder == null) {
          oldBuilder = "com.caucho.v5.jmx.MBeanServerBuilderImpl";
          props.put("javax.management.builder.initial", oldBuilder);
        }

        Object value = ManagementFactory.getPlatformMBeanServer();
      }
      */
    } catch (Throwable e) {
      log().log(Level.FINE, e.toString(), e);
    } finally {
      thread.setContextClassLoader(oldLoader);
      
      _isInitComplete = true;
    }
  }
444195
public void initialize() {
		// Initialize the SRE list
		this.runtimeEnvironments.clear();
		final ISREInstall[] sres = SARLRuntime.getSREInstalls();
		Arrays.sort(sres, new Comparator<ISREInstall>() {
			@Override
			public int compare(ISREInstall o1, ISREInstall o2) {
				return o1.getName().compareTo(o2.getName());
			}
		});
		final List<String> labels = new ArrayList<>(sres.length);
		for (int i = 0; i < sres.length; ++i) {
			if (sres[i].getValidity().isOK()) {
				this.runtimeEnvironments.add(sres[i]);
				labels.add(sres[i].getName());
			}
		}
		this.runtimeEnvironmentCombo.setItems(labels.toArray(new String[labels.size()]));

		// Reset the labels of the external SRE configurations
		updateExternalSREButtonLabels();

		// Initialize the type of configuration
		if (this.enableSystemWideSelector) {
			this.specificSREButton.setSelection(false);
			if (!this.projectProviderFactories.isEmpty()) {
				this.projectSREButton.setSelection(false);
			}
			this.systemSREButton.setSelection(true);
		} else if (!this.projectProviderFactories.isEmpty()) {
			this.specificSREButton.setSelection(false);
			if (this.enableSystemWideSelector) {
				this.systemSREButton.setSelection(false);
			}
			this.projectSREButton.setSelection(true);
		}

		// Wait for SRE list updates.
		this.sreListener = new InstallChange();
		SARLRuntime.addSREInstallChangedListener(this.sreListener);

		updateEnableState();
	}
224184
@SuppressWarnings("static-method")
	protected BQRuntime createRuntime(String... args) {
		SARLStandaloneSetup.doPreSetup();
		final BQRuntime runtime = Bootique.app(args).autoLoadModules().createRuntime();
		SARLStandaloneSetup.doPostSetup(runtime.getInstance(Injector.class));
		return runtime;
	}
612384
@Override
    public void buildEnvironment(Run<?,?> build, EnvVars env) {
        env.put(name,value);
        env.put(name.toUpperCase(Locale.ENGLISH),value); // backward compatibility pre 1.345
    }
791325
private static Properties getUnixShellVariables()
        throws EnvironmentException
    {
        Properties properties = new Properties();
        String cmdExec = getUnixEnv();

        int exitValue = readEnvironment( cmdExec, properties );

        // Check that we exited normally before returning an invalid output
        if( 0 != exitValue )
        {
            throw new EnvironmentException( "Environment process failed  with non-zero exit code of " + exitValue );
        }

        return properties;
    }
937789
public RuntimeEnvironmentBuilder addEnvironmentEntry(String name, Object value) {
        if (name == null || value == null) {
            return this;
        }
        _runtimeEnvironment.addToEnvironment(name, value);

        return this;
    }
1111886
@Override
    public void setEnvironment(Environment env) {
    	if (env instanceof AbstractEnvironment) {
    		this.env = (AbstractEnvironment)env;
    	} else {
    		throw new RuntimeException("env is not an AbstractEnvironment. " + env.getClass().getCanonicalName());
    	}
    	
    }
1225940
public function createCollection()
    {
        $collectClass = $this->collectionClass();
        if ($collectClass === 'array') {
            return [];
        }

        if (!class_exists($collectClass)) {
            throw new RuntimeException(sprintf(
                'Collection class [%s] does not exist.',
                $collectClass
            ));
        }

        if (!is_subclass_of($collectClass, ArrayAccess::class)) {
            throw new RuntimeException(sprintf(
                'Collection class [%s] must implement ArrayAccess.',
                $collectClass
            ));
        }

        $collection = new $collectClass;

        return $collection;
    }
1243545
def _create_run_config(options):
        """"""
        values = {opt: getattr(options, opt) for opt in
                       RunConfiguration._fields}
        return RunConfiguration(**values)
58449
protected function initEnvironment()
    {
        mb_internal_encoding('UTF-8');

        if (is_file($this->getFullEnvFilePath())) {
            $env = new DotEnv($this->basePath, $this->getEnvFile(), true);
            $env->load();
        }
    }
1023827
private function createProcess()
    {
        $descriptorSpec = [
            ['pipe', 'r'], // stdin
            ['pipe', 'w'], // stdout
            ['pipe', 'r']  // stderr
        ];

        $this->process = proc_open($this->cmd, $descriptorSpec, $this->pipes, $this->cwd);

        if (!is_resource($this->process)) {
            throw new \RuntimeException('Could not create the process.');
        }
    }
83250
public static Properties createCommonSystemProperties() throws EnvironmentException {
        // create a new system properties object
        Properties systemProperties = new Properties();

        // host name, domain, fqdn
        String hostFQDN = getHostFQDN();

        if (!StringUtil.isEmpty(hostFQDN)) {
            // save the fqdn
            systemProperties.put(HOST_FQDN, hostFQDN);

            // split up the fqdn to find the host name and domain
            String[] hostInfo = splitHostFQDN(hostFQDN);

            // save the host name and domain, defaulting to an empty string if null
            systemProperties.put(HOST_NAME, (hostInfo[0] != null ? hostInfo[0] : ""));
            systemProperties.put(HOST_DOMAIN, (hostInfo[1] != null ? hostInfo[1] : ""));

            // add a new host name
            //systemProperties.put(HOST_NAME, hostname);
        } else {
            systemProperties.put(HOST_FQDN, "");
            systemProperties.put(HOST_NAME, "");
            systemProperties.put(HOST_DOMAIN, "");
        }

        return systemProperties;
    }