Clion doesn't add changes to path.
Answered
I'm trying to add JLinkExe to the path variable of Clion. The JLinkExe parent directory is part of my system PATH variable, and I can call JLinkExe from any directory inside the terminal. When I go to settings>Build, Execution, Deployment>Cmake>environment I checked “include system enviornment variables”, and when I go to the value of the Path variable Clion is using I see that this variable didn't include the path to the parent directory of JLinkExe. The Path variable Clion is using differs from the one my system is using. How can I ‘refresh’ the system variables Clion is using? I have tried repairing the IDE and rebooting, but to no avail.
Please sign in to leave a comment.
Hello!
On what OS do you use CLion? How did you add the JLinkExe parent directory to the system PATH variable?
Hey!
I'm using Ubuntu 22.04.3 LTS. I added the JLinkExe parent directory to bashrc by adding the following line:
export PATH="/home/<username>/JLink_Linux_V792d_x86_64:$PATH"
When I print my system variables on terminal I get the following: PATH=/home/<username>/JLink_Linux_V792d_x86_64:/home/<username>/zephyr-sdk-0.16.1/arm-zephyr-eabi/bin:/home/<username>/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/snap/bin
Clion sees the following system variables after reloading: /home/<username>/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/snap/bin
So it appears to be missing variables I added myself. Do I have to manually refresh them, or is Clion supposed to automatically load them?
Thanks for the help!
If you start CLion from the same terminal, CLion should inherit the changed PATH value. Does it work this way on your side?
Please note that you can change
PATH
in the /etc/environment configuration file (instead of bashrc). This way, the new PATH value will be available regardless of whether you're working from the terminal or using a desktop launcher.The terminal shows this:
Clion sees this when I start it from the same terminal:
I added the variables to /etc/environment and restarted Clion. The results stayed the same. I'm going to try rebooting my machine to see if that helps.
It's still the same, Clion doesn't appear to be updating the PATH variable with my system's variables.
Please create a script updating PATH and add it to the toolchain - https://www.jetbrains.com/help/clion/quick-tutorial-on-configuring-clion-on-windows.html#env-scripts.
Does it help?