1

I wrote a small Julia program:

println("Hello world!")

I can run Julia from the Terminal:

$ /Applications/Julia-0.6.app/Contents/Resources/julia/bin/julia test.jl 
Hello world!

To make my life easier, I tried to create a symbolic link to the julia file. However, it doesn't seem to work!

$ sudo ln -s /Applications/Julia-0.6.app/Contents/Resources/bin/julia /usr/local/bin/julia
$ julia
-bash: julia: command not found
$ type -a julia
-bash: type: julia: not found

How do I get my symbolic link to work properly?

What is confusing for me is that /usr/local/bin/ is in my PATH:

$ echo $PATH
/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/TeX/texbin:/opt/X11/bin
1
  • What does the output of type -a julia says?
    – Nimesh Neema
    Commented Aug 14, 2018 at 11:50

2 Answers 2

2

I figured out what went wrong: I made a typographical mistake when I was creating the symbolic link!

WRONG

sudo ln -s /Applications/Julia-0.6.app/Contents/Resources/bin/julia /usr/local/bin/julia

CORRECT

sudo ln -s /Applications/Julia-0.6.app/Contents/Resources/julia/bin/julia /usr/local/bin/julia

(I was missing the julia in .../Resources/julia/bin/...)

1
  • 1
    Then the title of this question should be "Are my glasses on?" which is a question I should ask myself because I didn't see it either 😊.
    – athena
    Commented Aug 14, 2018 at 14:21
0

It's a better idea to add the folder that contains the binary to your $PATH instead of creating a link to the file inside /usr/local/bin.

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

This way, you don't need to create invidual links for every single file inside the bin folder if you ever want to use them.

You can also add this line to ~/.bash_profile for it to persist after you close the terminal.

You must log in to answer this question.

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