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?
You can exit and start your eclipse instead of restarting it. It should just work fine then.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With