Setting the environment for ProcessBuilder

前端 未结 6 1043
囚心锁ツ
囚心锁ツ 2020-12-06 17:14

I have a strange problem setting the Linux environment from Java (1.6); specifically the \"PATH\" variable.

In a nutshell, I have a pipeline for running native proce

6条回答
  •  有刺的猬
    2020-12-06 17:37

    One thing that is clear from the ProcessBuilder javadoc is that you can get the environment variables with the environment() method, and then modify the returned map. Any subsequent process that is launched from that ProcessBuilder instance will have your changes.

提交回复
热议问题