Reputation: 2593
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?
Upvotes: 8
Views: 7059
Reputation: 18966
How can I tell eclipse to reload environment variables each time I run my application?
Yes, You can easily define/simulate your Environment variables configurations during running the application inside Eclipse without need to restart it + without need to update them externally from your system:
Using Run Configurations...
Upvotes: 0
Reputation: 1691
You can exit and start your eclipse instead of restarting it. It should just work fine then.
Upvotes: 10
Reputation: 749
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.
Upvotes: 4