Creating fresh environment with latest julia whilst having existing 1.9 enviroment

The first time I installed Julia was a 1.9 environment. I now want to create a new project environment with the latest stable Julia version. I used juliaup add 1.11 to add the Julia 1.11 environment. Opening a Julia REPL, hitting ] to start the Pkg CLI and running the command activate fooBar creates an environment, but it does so using the old 1.9. I looked in the help and in the documentation of juliaup and Pkg but cannot find an explanation of how to make the new project environment make use of the 1.11 version of Julia. Could someone tell me how to do that step-by-step?

NB: I am aware it is possible to update the 1.9 environment to 1.11, but I explicitly do not want to do that. I want a fresh 1.11 environment.

You just need to start the correct Julia. This can be done either using julia +1.11 to explicitly force the version or you can change the default version using juliaup default +1.11 and afterwards the julia command defaults to 1.11

You can also setup per-project default Julia versions using direnv and the JULIAUP_CHANNEL environment variable.

2 Likes

Per directory Julia version is also directly supported now with juliaup override, see JuliaLang/juliaup#using-juliaup.

Although VS Code doesn’t take either of these methods into account yet (#3649).

2 Likes

And now you can also rename your Manifest.toml file to Manifest-v1.11.toml so to have an environment specific for this Julia version.

4 Likes