/** * Returns the value of the environment variable given by key. This method is a work around for * VM versions which do not support getenv in an other way. At the first call all environment * variables will be loaded via an exec. On Windows keys are not case sensitive. * * @param key variable name for which the value should be resolved * @return the value of the environment variable given by key */ public static String getenv(String key) { if (envVars == null) { loadEnv(); } if (envVars == null) { return (null); } if (OsVersion.IS_WINDOWS) { key = key.toUpperCase(); } return (String) (envVars.get(key)); }