Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Adding environment variables to Runtime.exec()

843798Apr 11 2005 — edited Apr 12 2005
Hello,

I'm trying to use Runtime.getRuntime().exec(command, envp);

When envp is null the program launches properly. (the doc says that the subprocess inherits the environment settings of the current process).

I want to add an environment variable, so when I use an array containing only my variable (envp), the process fails. I guess it needs the variables of the current process (as used when using null).

In that case, How adding a variable instead of replacing the default ??????
(I did not see any way to retrieve these default variables so I can concatenate with the custom one)

Thanks !
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 10 2005
Added on Apr 11 2005
3 comments
1,034 views