# Subtleties Around Environment Variable JULIA\_BINDIR

**URL:** <https://discourse.julialang.org/t/subtleties-around-environment-variable-julia-bindir/88028>\
**Category:** General Usage\
**Tags:** question, installation, environment, configuration\
**Created:** [September 30, 2022, 9:13am UTC](https://discourse.julialang.org/t/subtleties-around-environment-variable-julia-bindir/88028 "2022-09-30T09:13:11Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Guanglin\_Du](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/guanglin_du/32/43088_2.png) [@Guanglin\_Du](https://discourse.julialang.org/u/Guanglin_Du)\
**Post date:** [September 30, 2022, 9:13am UTC](https://discourse.julialang.org/t/subtleties-around-environment-variable-julia-bindir/88028/1 "2022-09-30T09:13:11Z")

</div>

1. The Running Configuration  
An LXC container instance based on Ubuntu 22.04 (Jammy) with Oh-my-zsh installed.

```julia
lsb_release -a

No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 22.04 LTS
Release: 22.04
Codename: jammy

```

1. To make Julia available globally, I extract the tar bar to directory /opt/.

```julia
sudo tar -xzf julia-1.8.1-linux-x86_64.tar.gz -C /opt/

```

1. Edit my ~/.zshrc file to update the environment variable PATH.  
At first, I created the JULIA\_HOME environment variable as I didn’t notice that JULIA\_BINDIR is recommended by the Julia official website.

```julia
# The settings for Julia
export JULIA_HOME="/opt/julia-1.8.1"
export PATH="$JULIA_HOME/bin:$PATH"
#export JULIA_BINDIR="/opt/julia-1.8.1"
#export PATH="$JULIA_BINDIR/bin:$PATH"
export JULIA_PKG_SERVER="https://mirrors.bfsu.edu.cn/julia"

```

1. Refresh the running configuration with the command `source ~/.zshrc` and then test Julia with the following commands without a hitch:

```julia
which julia
/opt/julia-1.8.1/bin/julia

julia --version
julia version 1.8.1

```

Function `versioninfo()` works well.

1. As hinted in 3, after I change JULIA\_HOME to JULIA\_BINDIR, and, then, `source ~/.zshrc`, or logout and login to make the changes take effect, I get the following error:

```julia
┌─[ubuntu@mycontainer][~]
└─%source ~/.zshrc
┌─[ubuntu@mycontainer][~]
└─%which julia
/opt/julia-1.8.1/bin/julia
┌─[ubuntu@mycontainer][~]
└─%julia
ERROR: could not load library "/opt/julia-1.8.1/../lib/julia/sys.so"
/opt/julia-1.8.1/../lib/julia/sys.so: cannot open shared object file: No such file or directory

```

1. **Stefan Karpinski** suggested using JULIA\_BINDIR instead of JULIA\_HOME. See [rename JULIA\_HOME?](https://github.com/JuliaLang/julia/issues/20899).

2. I’ve tested this scenario on both Ubuntu 20.04 and 22.04. Whether on the LXC container version, the standalone version, or the desktop version, the same subtleties exist.

3. After I changed the setting back to JULIA\_HOME, the error disappears.
