Search code examples
javalinuxintellij-ideaenvironment-variables

IntelliJ IDEA does not see my environment variables


I've configured an environment variable in ~/.bashrc as well as ~/.profile.

When I run my application via IDEA's Gradle Configuration, my environment variable is apparently not available. E.g. I am referencing this variable within application.yml, but the default value is being used instead. Running Gradle from the command line correctly picks up my variable.

How can I configure IDEA to load this environment variable in a global way, so I don't have to manually add it to every project where I need it (~20 projects)?

Note: running on Manjaro Linux v18.


Solution

  • It turns out IDEA will pick up environment variables if you define them either in e.g. /etc/environment or /etc/profile or if you use ZSH, ~/.zshrc.