# "command not found: julia" when running a UNIX executable

**URL:** <https://discourse.julialang.org/t/command-not-found-julia-when-running-a-unix-executable/38096>\
**Category:** New to Julia\
**Tags:** question\
**Created:** [April 23, 2020, 4:26pm UTC](https://discourse.julialang.org/t/command-not-found-julia-when-running-a-unix-executable/38096 "2020-04-23T16:26:16Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![themadprogramer](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/themadprogramer/32/14086_2.png) [@themadprogramer](https://discourse.julialang.org/u/themadprogramer)\
**Post date:** [April 23, 2020, 4:26pm UTC](https://discourse.julialang.org/t/command-not-found-julia-when-running-a-unix-executable/38096/1 "2020-04-23T16:26:16Z")

</div>

Recently I’ve really been trying to get into [Genie](https://github.com/GenieFramework/Genie.jl). To launch a Genie app, you either have to memorize a long command or just run one of 4 executables located in [the bin directory](https://genieframework.github.io/Genie.jl/documentation/4--Developing_Web_Services.html).

I noticed I was getting an error

> “command not found: julia”

I won’t pretend to be a shell expert so I’m here to ask for help. It was set to run in _sh_ and I’m on a MacOS Catalina which seems to have switched to _zsh_. I’ve tried changing the shebang to:

```bash
#!/bin/zsh

```

and am still getting “command not found: julia”. I can run the command if I copy paste it into my terminal so what gives?

---

<div class="post-metadata">

**Author:** ![stevengj](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stevengj/32/71_2.png) [@stevengj](https://discourse.julialang.org/u/stevengj)\
**Post date:** [April 23, 2020, 6:08pm UTC](https://discourse.julialang.org/t/command-not-found-julia-when-running-a-unix-executable/38096/2 "2020-04-23T18:08:09Z")

</div>

You have to make sure `julia` is in your `PATH` if you want to run it from the command line. On MacOS, I usually create a link:

```nohighlight
sudo ln -s /Applications/Julia-1.4.app/Contents/Resources/julia/bin/julia /usr/local/bin/julia

```

to create a symbolic link `/usr/local/bin/julia` to the Julia “app” installed in your `Applications` folder.

---

<div class="post-metadata">

**Author:** ![themadprogramer](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/themadprogramer/32/14086_2.png) [@themadprogramer](https://discourse.julialang.org/u/themadprogramer)\
**Post date:** [April 23, 2020, 6:10pm UTC](https://discourse.julialang.org/t/command-not-found-julia-when-running-a-unix-executable/38096/3 "2020-04-23T18:10:07Z")

</div>

> I can run the command if I copy paste it into my terminal so what gives?

Oh sorry, I forgot to explicitly mention julia was already is in my PATH. Like I said, copying the full command into the terminal works just fine, but it’s somehow missing from the _PATH_ for _bin/sh_, if that makes any sense. It shouldn’t be any different? Is it?

---

<div class="post-metadata">

**Author:** ![stevengj](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stevengj/32/71_2.png) [@stevengj](https://discourse.julialang.org/u/stevengj)\
**Post date:** [April 23, 2020, 6:17pm UTC](https://discourse.julialang.org/t/command-not-found-julia-when-running-a-unix-executable/38096/4 "2020-04-23T18:17:06Z")

</div>

> [@themadprogramer](#):
>
> Oh sorry, I forgot to explicitly mention julia was already is in my PATH. Like I said, copying the full command into the terminal works just fine, but it’s somehow missing from the _PATH_ for _bin/sh_ , if that makes any sense. It shouldn’t be any different? Is it?

Depends on how you set your `PATH`. If you set it in `~/.bash_profile`, that won’t do it for `/bin/sh`, for example. (I think `/bin/sh` uses `~/.profile`.)
