How to add a Julia path to my Terminal environment?

I just reinstalled my Mac OS and Julia 1.7. I’m trying to add the path to Julia to my terminal.

Below is the instructions I found:

Copy and paste these two commands into your shell:

rm -f /usr/local/bin/julia
ln -s /Applications/Julia-1.7.app/Contents/Resources/julia/bin/julia /usr/local/bin/julia

I got the below error:
ln: /usr/local/bin/julia: No such file or directory

Found an answer myself. I’ll keep this question for future reference purposes.

PATH="/Applications/Julia-1.7.app/Contents/Resources/julia/bin/:${PATH}"
export PATH
1 Like

I just realize that for my above solution, I would need to type it every time before I launch Julia. What is a permanent solution?

I tried to add the below to my .profile file but it did not work:
export JULIA_HOME = /Applications/Julia-1.7.app

Many thanks!

You would need to update the PATH in your shell profile.

For the ln -s approach, you might need to create the /usr/local/bin directory first, and you might need to use sudo (which requests that you enter your password):

sudo mkdir -p /usr/local/bin
sudo ln -s /Applications/Julia-1.7.app/Contents/Resources/julia/bin/julia /usr/local/bin/julia
1 Like

Many thanks! This works great.