# Working with different versions of Julia

**URL:** <https://discourse.julialang.org/t/working-with-different-versions-of-julia/97573>\
**Category:** Performance\
**Created:** [April 17, 2023, 1:41pm UTC](https://discourse.julialang.org/t/working-with-different-versions-of-julia/97573 "2023-04-17T13:41:20Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![erlebach](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/erlebach/32/12973_2.png) [@erlebach](https://discourse.julialang.org/u/erlebach)\
**Post date:** [April 17, 2023, 1:41pm UTC](https://discourse.julialang.org/t/working-with-different-versions-of-julia/97573/1 "2023-04-17T13:41:20Z")

</div>

Under normal circumstances, I work with a single version of Julia, say, Julia 1.8. I have a folder of Julia code, along with Project.toml and Manifest.toml files. I would also like to work with Julia 1.9. What is the strategy? Create a second folder with its own toml files (the Manifest contains the Julia version in its first line). If I create a second folder with code and toml files, I no longer have a single version of my code. What is the solution? I want to maintain a single version of my Julia code but run it with different versions of Julia. I am working with Visual Studio Code. Thanks for any insight.

---

<div class="post-metadata">

**Author:** ![gvanuxem](https://avatars.discourse-cdn.com/v4/letter/g/a587f6/32.png) [@gvanuxem](https://discourse.julialang.org/u/gvanuxem)\
**Post date:** [April 17, 2023, 3:38pm UTC](https://discourse.julialang.org/t/working-with-different-versions-of-julia/97573/2 "2023-04-17T15:38:00Z")

</div>

Two folders and just linked file code ?

I mean something like “ln -s” for example.

Just a suggestion. I do not know.

---

<div class="post-metadata">

**Author:** ![erlebach](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/erlebach/32/12973_2.png) [@erlebach](https://discourse.julialang.org/u/erlebach)\
**Post date:** [April 17, 2023, 3:45pm UTC](https://discourse.julialang.org/t/working-with-different-versions-of-julia/97573/3 "2023-04-17T15:45:14Z")

</div>

I actually used a regular link (so that I could delete one or the other file without adverse consequence. However, the approach is not satisfactory to me. Since the Manifest contains the version of Julia on the first line, I would prefer either that the julia version be appended to the Manifest name, for example, `Manifest\_1\_9.toml, or a single manifest file that contains data for multiple Julia instances.

---

<div class="post-metadata">

**Author:** ![awasserman](https://avatars.discourse-cdn.com/v4/letter/a/9de0a6/32.png) [@awasserman](https://discourse.julialang.org/u/awasserman)\
**Post date:** [April 17, 2023, 4:01pm UTC](https://discourse.julialang.org/t/working-with-different-versions-of-julia/97573/4 "2023-04-17T16:01:10Z")

</div>

I like the tool [asdf](https://asdf-vm.com/) for managing different versions of programming languages. It has a Julia plugin available [here](https://github.com/rkyleg/asdf-julia).

Once you have both asdf and the julia plugin installed, you can do the following:

```sh
asdf install julia 1.8.5
asdf install julia 1.9.0-rc2
asdf global julia 1.8.5
asdf local julia 1.9.0-rc2
asdf reshim

```

This will download julia versions 1.8.5 and 1.9.0-rc2 in an asdf-managed directory, set the global julia version to be 1.8.5, and set the version of julia used in the current local directory (manged with a `.tool-version` file) to be 1.9.0-rc2.

I don’t use VS Code, so I’m not sure how well this works for your case, but others might know.

---

<div class="post-metadata">

**Author:** ![lmiq](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lmiq/32/18314_2.png) [@lmiq](https://discourse.julialang.org/u/lmiq)\
**Post date:** [April 17, 2023, 6:20pm UTC](https://discourse.julialang.org/t/working-with-different-versions-of-julia/97573/5 "2023-04-17T18:20:39Z")

</div>

First, not considering the VSCode part, you can create a directory associated with each julia version, for example:

```julia
MyPkg_Julia1.9
#and
MyPkg_Julia1.6

```

then start Julia with the appropriate version within each folder, activate the environment of that folder, and `dev MyPkg` there.

I don’t know if you can use different Julia versions at the same time in VSCode, I know you can switch versions by closing VSCode and restarting it, and the easiest way I know for that is involving `juliaup`:

Install two different versions of `julia` with `juliaup`, and you can switch which is the default version using

```julia
juliaup default 1.9
#or
juliaup default 1.6

```

and then the next time you start VSCode the default version will be the one used (if you left the julia executable path empty in the extension settings, which is what I do).

Combining both things it is possible to have a reasonably practical way to work with two Julia versions, at least in an alternating way.

---

<div class="post-metadata">

**Author:** ![gdalle](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gdalle/32/27854_2.png) [@gdalle](https://discourse.julialang.org/u/gdalle)\
**Post date:** [April 17, 2023, 6:37pm UTC](https://discourse.julialang.org/t/working-with-different-versions-of-julia/97573/6 "2023-04-17T18:37:31Z")

</div>

As for the different versions of Julia, juliaup is the easiest tool. As for the different versions of a package, I would recommend two branches of a git project?

---

<div class="post-metadata">

**Author:** ![erlebach](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/erlebach/32/12973_2.png) [@erlebach](https://discourse.julialang.org/u/erlebach)\
**Post date:** [April 23, 2023, 8:46pm UTC](https://discourse.julialang.org/t/working-with-different-versions-of-julia/97573/7 "2023-04-23T20:46:12Z")

</div>

Thank you all for your suggestions. At this time, I create two folders, one per julia version, and simply make sure the same Project.toml is in each folder. I then use symbolic links. Git branches are also a good solution for me. Thanks!
