set windows PATH environment variable at runtime in Java

Posted by hhhh on Stack Overflow See other posts from Stack Overflow or by hhhh
Published on 2010-04-29T22:24:48Z Indexed on 2010/04/29 22:27 UTC
Read the original article Hit count: 335

I have a java program that fires off an executable using the Runtime.exec() method. I'm using the variant that takes in a set of command line params as one argument, and some environment variables as another argument.

The environment variable I'm tryign to set is path, so i'm passing in "PATH=C:\some\path". This does not work. Is there some trick to this or any alternatives. I am stuck to Java 1.4 unfortunately.

© Stack Overflow or respective owner

Related posts about java

Related posts about environment-variables