# How to set the environment variable MATLAB\_ROOT when installing MATLAB.jl?

**URL:** https://discourse.julialang.org/t/how-to-set-the-environment-variable-matlab-root-when-installing-matlab-jl/73536
**Category:** General Usage
**Tags:** package
**Created:** [December 23, 2021, 4:39pm UTC](https://discourse.julialang.org/t/how-to-set-the-environment-variable-matlab-root-when-installing-matlab-jl/73536 "2021-12-23T16:39:38Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![leon](https://avatars.discourse-cdn.com/v4/letter/l/dc4da7/32.png) [@leon](https://discourse.julialang.org/u/leon)
#### Post date: [December 23, 2021, 4:39pm UTC](https://discourse.julialang.org/t/how-to-set-the-environment-variable-matlab-root-when-installing-matlab-jl/73536/1 "2021-12-23T16:39:38Z")

</div>

My goal is to install MATLAB.jl package. The instructions say the below"

“By default, `MATLAB.jl` uses the MATLAB installation with the greatest version number. To specify that a specific MATLAB installation should be used, set the environment variable `MATLAB_ROOT` .”

Here is my question. How do I set the environmental variable “`MATLAB_ROOT`”?

My Matlab was installed at `/home/name/MATLB/R2021b/bin/`

---

<div class="post-metadata">

### Author: ![jling](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jling/32/212909_2.png) [@jling](https://discourse.julialang.org/u/jling)
#### Post date: [December 23, 2021, 4:41pm UTC](https://discourse.julialang.org/t/how-to-set-the-environment-variable-matlab-root-when-installing-matlab-jl/73536/2 "2021-12-23T16:41:10Z")

</div>

an environment variable is not something you usually set within Julia, but technically you can do:

```julia
julia> ENV["MATLAB_ROOT"] = "/home/name/MATLB/R2021b/bin/"

```

---

<div class="post-metadata">

### Author: ![leon](https://avatars.discourse-cdn.com/v4/letter/l/dc4da7/32.png) [@leon](https://discourse.julialang.org/u/leon)
#### Post date: [December 23, 2021, 4:56pm UTC](https://discourse.julialang.org/t/how-to-set-the-environment-variable-matlab-root-when-installing-matlab-jl/73536/3 "2021-12-23T16:56:59Z")

</div>

Many thanks for the help!
