Run reloading environment variables in IntelliJ ... without rebooting?

The title says it all.

I changed the environment variable that is used in my java project through, for example, this line in my pom.xml:

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

For the changes to take effect, I must manually restart IntelliJ.

Interestingly, I installed the IntelliJ plugin to ā€œrestartā€ IntelliJ, which it does, but the environment variables are not updated.

Is there any way to do this without restarting?

+6
source share
3 answers

Impossible. After starting the process on Windows or Unix, you will not be able to read the updated environment variables from the outside. You can change environment variables inside your process.

This IntelliJ plugin may not completely restart the application, but, for example, use a different class loader.

+7
source

If you started IntelliJ through the "JetBrains Toolbox", then to reload the environment variables, you need to close them both (IntelliJ and Toolbox), launch the toolbar, and then launch IntelliJ through the toolbar.

+1
source

On Linux / UNIX, perhaps the shell can use the source profile, for example:, / etc. / profile Update env without leaving the current shell.

-3
source

Source: https://habr.com/ru/post/956639/


All Articles