Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 300
vikingsteve Avatar asked Oct 24 '13 11:10

vikingsteve


People also ask

How do I reload environment variables in IntelliJ?

An IntelliJ IDEA plugin to automatically add environment variables to Path Variables. Environment variable are added to Path Variables with "env." prefix to avoid collisions. To reload the environment variables loaded: Tools -> Reload Environment Variables in Path Variables.

How do you reload environment variables?

2. Refresh Environment Variables via Command Prompt (CMD) Step 1: In the Start menu, search for Command Prompt and run it as an administrator. Step 2: Type the command: “set PATH = c” (without quotation marks), press the enter key, and restart the Command Prompt.

Do I need to restart for environment variables?

No, you don't need to restart your system. However, you have to restart your command prompt application to update the changes done on Environment variables.

How do I change the path in Pycharm?

Create a new path variablePress Ctrl+Alt+S to open the IDE settings and select Appearance & Behavior | Path Variables. and enter the name of the new variable (for example, DATA_PATH ) and its value that points to the target directory with the data file on your disk.


2 Answers

If you started IntelliJ through "JetBrains Toolbox", then in order to reload the environment variables you need to close them both (IntelliJ & Toolbox), start the toolbox, and then start IntelliJ via the toolbox.

like image 77
Eng.Fouad Avatar answered Sep 17 '22 13:09

Eng.Fouad


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.

like image 42
Andrey Chaschev Avatar answered Sep 19 '22 13:09

Andrey Chaschev