javamavenintellij-idea

Force reload of environment variables in IntelliJ... without restarting?


The title says it all.

I have modified an environment variable which is used in my java project via, for example, this line in my pom.xml:

<url>${env.DB_CONNECTION_URL}</url>

For this change to take effect, I must manually restart IntelliJ.

Interestingly, I installed an IntelliJ plugin to "Restart" IntelliJ, which it does, but the environment variables are not refreshed.

Is there a way to do this, without restarting?


Solution

  • Not possible. Once you start a process in Windows or in Unix, you can't read updated environment variables from outside. You can only change environment variables inside your process.

    This IntelliJ plugin might not be completely restarting the app, but is i.e. using a different class loader instead.