I set up an environment variable (Under IDE Settings -> Path Variables
)
APP_HOME = /path/to/app_home
One of my tests is failing however with
System.out.println("APP HOME: " + APP_HOME);
With
APP HOME: null/
It does not look like that env variable is being read. What am i missing?
Click edit configurations on the dropdown box for your runtime configurations. Select the runtime you want to add environment variables to. Click environment variables folder icon to pull up the environment variables screen. From here you can add as many environment variables as you want.
Open settings, then select plugins In the search box search for “. env files support” and install it. After restarting IntelliJ you will have a new tab in the Run Configurations screen called EnvFile.
Path Variables dialog has nothing to do with the environment variables.
Environment variables can be specified in your OS or customized in the Run configuration:
If the above answer + restarting the IDE didn't do, try restarting "Jetbrains Toolbox" if you use it, this did it for me
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