Using export in Java

前端 未结 2 1834
野的像风
野的像风 2020-12-07 04:27

I am using java to call another program which relies on an exported environment variable to function:

SOME_VARIABLE=/home/..
export SOME_VARIABLE
         


        
2条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-07 05:09

    Perhaps you can use System#setProperty(String property, String value), though I'm not sure if this will change anything outside of the current JVM, which means this environment variable will only be available to processes that the current JVM starts.

提交回复
热议问题