-1

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

0

1 Answer 1

0

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.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.