# How can I restart Julia

**URL:** https://discourse.julialang.org/t/how-can-i-restart-julia/129840
**Category:** New to Julia
**Created:** [June 12, 2025, 3:41pm UTC](https://discourse.julialang.org/t/how-can-i-restart-julia/129840 "2025-06-12T15:41:00Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![Smara\_Kazenango](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/smara_kazenango/32/130333_2.png) [@Smara\_Kazenango](https://discourse.julialang.org/u/Smara_Kazenango)
#### Post date: [June 12, 2025, 3:41pm UTC](https://discourse.julialang.org/t/how-can-i-restart-julia/129840/1 "2025-06-12T15:41:00Z")

</div>

What command can I run to restart Julia and does this have impact on any of the packages already installed.

---

<div class="post-metadata">

### Author: ![kellertuer](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kellertuer/32/220707_2.png) [@kellertuer](https://discourse.julialang.org/u/kellertuer)
#### Post date: [June 12, 2025, 4:50pm UTC](https://discourse.julialang.org/t/how-can-i-restart-julia/129840/2 "2025-06-12T16:50:44Z")

</div>

You can find key shortcuts at [The Julia REPL · The Julia Language](https://docs.julialang.org/en/v1/stdlib/REPL/#Key-bindings), so its `^D` (you can also type `exit()`) and then restart it again.  
That of course depends on which system/IDE you are on (Terminal or Mac OS App or VS Code or what you use)

All packages installed will still be installed (e.g. with `add MyPackage, YourPackage`), but you have to do `using YourPackage`s again to be able to use them.

Do you have a specific reason to restart?

---

<div class="post-metadata">

### Author: ![ufechner7](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ufechner7/32/51363_2.png) [@ufechner7](https://discourse.julialang.org/u/ufechner7)
#### Post date: [June 12, 2025, 5:06pm UTC](https://discourse.julialang.org/t/how-can-i-restart-julia/129840/3 "2025-06-12T17:06:06Z")

</div>

I define a macro in my `.bashrc` file like this:

```julia
alias jl='julia --project'

```

so that I can quickly restart Julia with `<CTRL>+<D>jl<ENTER>` . Restarting Julia is for example useful if you redefined a struct or a typed global variable.

---

<div class="post-metadata">

### Author: ![rafael.guerra](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rafael.guerra/32/216610_2.png) [@rafael.guerra](https://discourse.julialang.org/u/rafael.guerra)
#### Post date: [June 12, 2025, 5:45pm UTC](https://discourse.julialang.org/t/how-can-i-restart-julia/129840/4 "2025-06-12T17:45:27Z")

</div>

Link to related thread:

> [@Programmatically restart julia](https://discourse.julialang.org/t/programmatically-restart-julia/73806/6):
>
> FYI, a more complete function by @fredrikekre is [available here](https://github.com/JuliaLang/julia/issues/32129#issue-448121208), and it is called restart(). I added it to the startup.jl file and tested it in VS Code and in a standalone Julia REPL and it seems to work very well. For the latter, it restarts the REPL in the same window very quickly in Julia 1.9 and thus, it might be seen as a “clear workspace” analogue.

---

<div class="post-metadata">

### Author: ![photor](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/photor/32/14343_2.png) [@photor](https://discourse.julialang.org/u/photor)
#### Post date: [June 13, 2025, 3:40am UTC](https://discourse.julialang.org/t/how-can-i-restart-julia/129840/5 "2025-06-13T03:40:09Z")

</div>

What is the `--project` for?

---

<div class="post-metadata">

### Author: ![ufechner7](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ufechner7/32/51363_2.png) [@ufechner7](https://discourse.julialang.org/u/ufechner7)
#### Post date: [June 13, 2025, 5:42am UTC](https://discourse.julialang.org/t/how-can-i-restart-julia/129840/6 "2025-06-13T05:42:38Z")

</div>

A Project is a folder that contains a `Project.toml` file. This file contains a list of the packages that you are using for this project. This avoids problems in the long run. For details see: [Working with Julia projects | Julia programming notes](https://ufechner7.github.io/2022/08/16/julia-projects.html)

Starting Julia without `--project` will use the global Project.toml . To see see what is in your global environment type `]st` . Try to keep your global environment clean.

---

<div class="post-metadata">

### Author: ![RobertGregg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/robertgregg/32/22105_2.png) [@RobertGregg](https://discourse.julialang.org/u/RobertGregg)
#### Post date: [June 13, 2025, 5:54am UTC](https://discourse.julialang.org/t/how-can-i-restart-julia/129840/7 "2025-06-13T05:54:48Z")

</div>

If you’re using VSCode you can use ALT + J + K to kill/close Julia, then you can use ALT + J + O to open a new Julia REPL. I tend to hold down the ALT key then type “jkjo” to perform this quickly.

This will not impact any packages installed, but you will have to reload packages in like “using Package”.

---

<div class="post-metadata">

### Author: ![PatrickHaecker](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/patrickhaecker/32/222891_2.png) [@PatrickHaecker](https://discourse.julialang.org/u/PatrickHaecker)
#### Post date: [June 13, 2025, 6:47am UTC](https://discourse.julialang.org/t/how-can-i-restart-julia/129840/8 "2025-06-13T06:47:20Z")

</div>

You can also use `Ctrl` + `Shift` + `P` and then enter `restart` and select `Julia: Restart REPL` in VSCode.  
If you do not use any other command with `restart`, it will be at the top position after entering `restart` and you can directly execute it with `enter`.  
If you haven’t entered a different command, you can even skip entering `restart` and hit `enter` directly.  
This works if you do not have an open REPL, too.

---

<div class="post-metadata">

### Author: ![PeterSimon](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/petersimon/32/25193_2.png) [@PeterSimon](https://discourse.julialang.org/u/PeterSimon)
#### Post date: [June 13, 2025, 12:47pm UTC](https://discourse.julialang.org/t/how-can-i-restart-julia/129840/9 "2025-06-13T12:47:15Z")

</div>

> [@RobertGregg](#):
>
> If you’re using VSCode you can use ALT + J + K to kill/close Julia, then you can use ALT + J + O to open a new Julia REPL. I tend to hold do

You can simply type `ALT` + `j` and then `ALT` + `r` to close the running Julia session, if any, and then (re)start a new one. The `r` is mnemonic for “restart”.

---

<div class="post-metadata">

### Author: ![Alfredo](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/alfredo/32/218064_2.png) [@Alfredo](https://discourse.julialang.org/u/Alfredo)
#### Post date: [August 5, 2025, 12:37pm UTC](https://discourse.julialang.org/t/how-can-i-restart-julia/129840/11 "2025-08-05T12:37:54Z")

</div>

You can restart Julia by simply closing the Julia REPL (or the terminal/IDE you’re using) and reopening it. If you’re using VS Code, there’s a “Restart Julia” option in the Julia extension toolbar.

Restarting Julia won’t affect your installed packages; they remain intact. However, you’ll need to reload any packages manually using PackageName after restarting.
