Possible Duplicate:
How do I set environment variables from Java?
I know, I can get a variable from environment by System.getenv, but how do I put a variable into environment in java?
Thanks
Possible Duplicate:
How do I set environment variables from Java?
I know, I can get a variable from environment by System.getenv, but how do I put a variable into environment in java?
Thanks
Environment is associated with each process in the system and is inherited by a child process from the parent process. Every process can read and modify its own environment and it can prepare environment to be passed to a child process. For example, you cannot put variables into the shell/cmd.exe from which you launched your JVM from within the JVM.
In order to put a variable into the environment of a process you're about to execute you can use ProcessBuilder.