When I launch IntelliJ from my Favorite icon and then launch a Maven Run Configuration, system environment variables (those exported in ~/.bashrc) are not recognized inside IntelliJ. If I run the same idea.sh that is run from the Favorites icon, then they are defined.


  • Question on Stack Overflow, but this issue is more about Ubuntu passing of environment than IntelliJ specifics.
  • Question on Ask Ubuntu about Eclipse, but that recommends a shell script, which is already the case here.

Contents of the desktop file:

    [Desktop Entry]
    Name=IntelliJ IDEA Ultimate Edition
    Exec="/hdd/executables/idea-IU-191.6707.61/bin/idea.sh" %f
    Comment=Capable and Ergonomic IDE for JVM

1 Answer 1


Set the variables in ~/.profile instead of ~/.bashrc.

You may want to study the page EnvironmentVariables for explanations.

  • I moved the code setting these variables from .bashrc to .profile. I logged out and in; and confirmed with env that the values where there. But still, the values do not appear in Intellij
    – Joshua Fox
    May 21, 2019 at 20:16
  • @JoshuaFox: That's a bit odd. Possibly a reboot is needed for the desktop environment you are using. May 21, 2019 at 20:36
  • @JoshuaFox: Btw, are you running Wayland? May 21, 2019 at 20:38
  • echo $XDG_SESSION_TYPE gives x11, so, apparently not Wayland. This is a recently installed Ubuntu 18.04.2 LTS
    – Joshua Fox
    May 22, 2019 at 6:22

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .