0

I have a piece of code that looks something like this:

if(System.getenv(ZOOKEEPER_HOSTS_SYS) == null){
    //here I want to do something like:
    //System.setenv(ZOOKEEPER_HOSTS_SYS,"");
}

Any idea how to set the environment variable like in the comment?

I do not want to launch a new process or anything like that, I want to set it for the current process.

Thanks. Regards,

Serban

Vivek Singh
  • 2,007
  • 9
  • 24
Serban Stoenescu
  • 2,308
  • 3
  • 19
  • 37

1 Answers1

-3

You can use System.getProperty and System.setProperty

pawinder gupta
  • 1,197
  • 14
  • 32