code: public void setEnv(Map<String, String> newSettings) throws Exception {
  		if (newSettings == null || newSettings.isEmpty()) {
  			return;
  		}
  		
  		// Update Environment variables in the JVM
  		try {			
  			Class<?> processEnvironmentClass = Class.forName("java.lang.ProcessEnvironment");
  			Field theEnvironmentField = processEnvironmentClass.getDeclaredField("theEnvironment");
  			theEnvironmentField.setAccessible(true);
  			Map<String, String> env = (Map<String, String>) theEnvironmentField.get(null);
  			env.clear();
  			env.putAll(newSettings);
  			Field theCaseInsensitiveEnvironmentField = processEnvironmentClass
  					.getDeclaredField("theCaseInsensitiveEnvironment");
  			theCaseInsensitiveEnvironmentField.setAccessible(true);
  			Map<String, String> cienv = (Map<String, String>) theCaseInsensitiveEnvironmentField.get(null);
  			cienv.clear();
  			cienv.putAll(newSettings);
  			WorkerLogManager.getSystemLogger().log(Level.INFO,
  					"Finished resetting environment variables in the JVM");
  		} catch (NoSuchFieldException e) {
  			Class[] classes = Collections.class.getDeclaredClasses();
  			Map<String, String> env = System.getenv();
  			for (Class cl : classes) {
  				if ("java.util.Collections$UnmodifiableMap".equals(cl.getName())) {
  					Field field = cl.getDeclaredField("m");
  					field.setAccessible(true);
  					Object obj = field.get(env);
  					Map<String, String> map = (Map<String, String>) obj;
  					map.clear();
  					map.putAll(newSettings);
  				}
  			}
  		}
  	}
docs: /*
  This is a helper utility specifically to reload environment variables if java
  language worker is started in standby mode by the functions runtime and
  should not be used for other purposes