How do I set environment variables from Java? I see that I can do this for subprocesses using ProcessBuilder. I have several subprocesses to start, though, so I'd rather modify the current process's environment and let the subprocesses inherit it. There's a System.getenv(String) for getting a single environment variable. I can also get a Map of the complete set of environment variables with System