Invoking Julia from the Terminal on MacOS

happy to found julia after long time of hesitations in the choice of a language to make animated graphicals mathematics
now, i follow the instructions on
i type “julia” in a temrinal windows of my mac os X.10.4
in the julia session i type : julia essai.jl
answer :
ERROR: UndefVarError: julia not defined
i guess that something is wrong with the fact that i installed julia throught a dmg file while the use of julia in the termonal shoul have maybe needed a mor "deep "installation with the sources etc ?
if anyone can help for this ultra-beggining question…
thanks !


To invoke Julia in the Terminal, you need to make sure that the julia command-line program is in your PATH. On MacOS, I usually do this by creating a link in /usr/local/bin:

sudo ln -s /Applications/ /usr/local/bin/julia

(Assuming you have installed “Julia-0.5” into your Applications folder, as is typical.)


Also, the command in that doc is shell command used to run the script,not how you run a script once you’re in the julia REPL. To run a script in the REPL use include("script_path.jl")

1 Like

ok thank you both of you
both work now :
julia essai.jl from the terminal
include(“essai.jl”) from the julia prompt
i prefer the first method
now i can start

Exactly what I needed. Thanks @stevengj