1

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.

Related:

  • 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]
    Version=1.0
    Type=Application
    Name=IntelliJ IDEA Ultimate Edition
    Icon=/hdd/executables/idea-IU-191.6707.61/bin/idea.svg
    Exec="/hdd/executables/idea-IU-191.6707.61/bin/idea.sh" %f
    Comment=Capable and Ergonomic IDE for JVM
    Categories=Development;IDE;
    Terminal=false
    StartupWMClass=jetbrains-idea
Pang
  • 371
  • 1
  • 5
  • 12
Joshua Fox
  • 2,791
  • 9
  • 27
  • 40
  • Related: [Set variable in .desktop file](https://askubuntu.com/questions/144968/set-variable-in-desktop-file) and [.desktop file with .bashrc environment](https://askubuntu.com/questions/542152/desktop-file-with-bashrc-environment) (FWIW I don't recommend the accepted answer in the second case) – steeldriver May 21 '19 at 14:23
  • Thank you. The first link is about 'manually' setting the env variables; I want them to come from the system. The second link looks relevant. What answer do you recommend if not the accepted answer? – Joshua Fox May 21 '19 at 19:27

1 Answers1

2

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

You may want to study the page EnvironmentVariables for explanations.

Gunnar Hjalmarsson
  • 32,938
  • 3
  • 63
  • 94