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,047
  • 11
  • 24
Serban Stoenescu
  • 3,136
  • 3
  • 22
  • 41

1 Answers1

-3

You can use System.getProperty and System.setProperty

pawinder gupta
  • 1,225
  • 16
  • 35