1
votes

I am using oh-my-zsh for my terminal. I have set IntelliJ to use /bin/zsh as the shell path. However no environment variable in my .zshrc file ever seems to get picked up. I'm defining environment variables like this (for instance):

export GOOGLE_APPLICATION_CREDENTIALS="$HOME/mailcreds.json"

But if I run:

echo $GOOGLE_APPLICATION_CREDENTIALS

Nothing comes up.

2

2 Answers

2
votes

Set environment variables in ~/.profile instead of ~/.bashrc or ~/.zshrc, see this issue for details.

0
votes

For Ubuntu, I edited my IDE desktop launcher to run zsh instead with login interactive:

  1. Go to /usr/share/applications (where the desktop entry usually located).
  2. Edit jetbrains-idea.desktop(might be named differently).
  3. Change Exec field to include /bin/zsh -l -i -c "/opt/intellij/bin/idea.sh".

The final result of the file:

[Desktop Entry]
Version=1.0
Type=Application
Name=IntelliJ IDEA Ultimate Edition
Icon=/opt/intellij/bin/idea.svg
Exec=/bin/zsh -l -i -c "/opt/intellij/bin/idea.sh" %f
Comment=Capable and Ergonomic IDE for JVM
Categories=Development;IDE;
Terminal=false
StartupWMClass=jetbrains-idea
StartupNotify=true