Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Tell eclipse to reload environment variables

I'm setting an environment variable in a .bat file using set and setx which is executed by my java application.

But the next time I run my application the environment variables are back to their old values - I have to restart Eclipse for the changes to take effect.

How can I tell eclipse to reload environment variables each time I run my application?

like image 575
jhasse Avatar asked Dec 13 '11 15:12

jhasse


2 Answers

You can exit and start your eclipse instead of restarting it. It should just work fine then.

like image 177
noor Avatar answered Sep 20 '22 19:09

noor


Environment variables set with "set" are set for the current process and its children. If you leave the process, the values are lost.

The "setx" command sets an environment variable in the system environment. But the values are read into the process only on restart. So eclipse still has the old environment variables and started processes will inherit these.

like image 22
Ulf Jaehrig Avatar answered Sep 19 '22 19:09

Ulf Jaehrig