# Fail to execute startup.jl

**URL:** <https://discourse.julialang.org/t/fail-to-execute-startup-jl/39936>\
**Category:** General Usage\
**Created:** [May 22, 2020, 6:07am UTC](https://discourse.julialang.org/t/fail-to-execute-startup-jl/39936 "2020-05-22T06:07:07Z")\
**Posts on this page:** 19\
**Page:** 1

<div class="post-metadata">

**Author:** ![Philippe\_Maincon1](https://avatars.discourse-cdn.com/v4/letter/p/ec9cab/32.png) [@Philippe\_Maincon1](https://discourse.julialang.org/u/Philippe_Maincon1)\
**Post date:** [May 22, 2020, 6:07am UTC](https://discourse.julialang.org/t/fail-to-execute-startup-jl/39936/1 "2020-05-22T06:07:07Z")

</div>

I have just installed Julia 1.4.1 on Windows. I have a trusty startup.jl file in C:\Users\myuser\.julia\config

I can directly execute the file, but on [re]starting Julia (CTRL+j,k) startup.jl is not executed. The doc does not suggest a new (ref the old .juliarc.jl) change in startup file convention. What did I miss…

: )

Philippe

---

<div class="post-metadata">

**Author:** ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Post date:** [May 22, 2020, 9:16am UTC](https://discourse.julialang.org/t/fail-to-execute-startup-jl/39936/2 "2020-05-22T09:16:28Z")

</div>

It should be

```julia
~/.julia/config/startup.jl

```

See [Getting Started · The Julia Language](https://docs.julialang.org/en/v1/manual/getting-started/#man-getting-started-1)

---

<div class="post-metadata">

**Author:** ![Philippe\_Maincon1](https://avatars.discourse-cdn.com/v4/letter/p/ec9cab/32.png) [@Philippe\_Maincon1](https://discourse.julialang.org/u/Philippe_Maincon1)\
**Post date:** [May 22, 2020, 9:27am UTC](https://discourse.julialang.org/t/fail-to-execute-startup-jl/39936/3 "2020-05-22T09:27:53Z")

</div>

Thank you for taking the time. That’s actually where I have the startup file ( \. was typeset as . by this web site, see my corrected post above). Any suggestions?

---

<div class="post-metadata">

**Author:** ![pfitzseb](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pfitzseb/32/45566_2.png) [@pfitzseb](https://discourse.julialang.org/u/pfitzseb)\
**Post date:** [May 22, 2020, 9:32am UTC](https://discourse.julialang.org/t/fail-to-execute-startup-jl/39936/4 "2020-05-22T09:32:12Z")

</div>

Juno by default keeps a few Julia processes running to mitigate the long startup time we currently have. You can turn that feature off with the `Boot Mode` option (in the julia-client settings):

 ![image](https://global.discourse-cdn.com/julialang/original/3X/c/f/cfdc6e5a862b8fbf13319e60cac4884dbc6a53b8.png)

Even when using the Process Cycler you can kill a few (~3) processes one after the other, after which your new startup.jl should be loaded.

---

<div class="post-metadata">

**Author:** ![Philippe\_Maincon1](https://avatars.discourse-cdn.com/v4/letter/p/ec9cab/32.png) [@Philippe\_Maincon1](https://discourse.julialang.org/u/Philippe_Maincon1)\
**Post date:** [May 22, 2020, 9:41am UTC](https://discourse.julialang.org/t/fail-to-execute-startup-jl/39936/5 "2020-05-22T09:41:24Z")

</div>

Thank you. I have now tried this: switched from “Cycler” to “Basic”. This is slower, as you indicate, but my startup.jl is still not executed.

---

<div class="post-metadata">

**Author:** ![pfitzseb](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pfitzseb/32/45566_2.png) [@pfitzseb](https://discourse.julialang.org/u/pfitzseb)\
**Post date:** [May 22, 2020, 9:46am UTC](https://discourse.julialang.org/t/fail-to-execute-startup-jl/39936/6 "2020-05-22T09:46:12Z")

</div>

I can’t repro this – just putting `println("startup")` into my startup file works fine.

---

<div class="post-metadata">

**Author:** ![Philippe\_Maincon1](https://avatars.discourse-cdn.com/v4/letter/p/ec9cab/32.png) [@Philippe\_Maincon1](https://discourse.julialang.org/u/Philippe_Maincon1)\
**Post date:** [May 22, 2020, 9:50am UTC](https://discourse.julialang.org/t/fail-to-execute-startup-jl/39936/7 "2020-05-22T09:50:26Z")

</div>

…and I wouldn’t know how to send you a reproduceable bug report for this case. I have replaced my file with a hello world - still no execution (so it’s not due to a bug in my startup file).

Are Julia and I disagreeing on what my username is?

---

<div class="post-metadata">

**Author:** ![pfitzseb](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pfitzseb/32/45566_2.png) [@pfitzseb](https://discourse.julialang.org/u/pfitzseb)\
**Post date:** [May 22, 2020, 9:53am UTC](https://discourse.julialang.org/t/fail-to-execute-startup-jl/39936/8 "2020-05-22T09:53:31Z")

</div>

Juno has a `Julia: Open Julia Startup File` command. Can you check whether that opens the file you’re expecting it to?

---

<div class="post-metadata">

**Author:** ![Philippe\_Maincon1](https://avatars.discourse-cdn.com/v4/letter/p/ec9cab/32.png) [@Philippe\_Maincon1](https://discourse.julialang.org/u/Philippe_Maincon1)\
**Post date:** [May 22, 2020, 10:00am UTC](https://discourse.julialang.org/t/fail-to-execute-startup-jl/39936/9 "2020-05-22T10:00:58Z")

</div>

> [@pfitzseb](#):
>
> Julia: Open Julia Startup File

Yes it does. That eliminates a disagreement on the user name. ???

---

<div class="post-metadata">

**Author:** ![pfitzseb](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pfitzseb/32/45566_2.png) [@pfitzseb](https://discourse.julialang.org/u/pfitzseb)\
**Post date:** [May 22, 2020, 10:44am UTC](https://discourse.julialang.org/t/fail-to-execute-startup-jl/39936/10 "2020-05-22T10:44:39Z")

</div>

It should, yes. No idea what’s going on then.  
Have you accidentally set `--startup-file=no` in julia-client’s `Additional Julia Startup Arguments`?

---

<div class="post-metadata">

**Author:** ![Philippe\_Maincon1](https://avatars.discourse-cdn.com/v4/letter/p/ec9cab/32.png) [@Philippe\_Maincon1](https://discourse.julialang.org/u/Philippe_Maincon1)\
**Post date:** [May 22, 2020, 10:52am UTC](https://discourse.julialang.org/t/fail-to-execute-startup-jl/39936/11 "2020-05-22T10:52:28Z")

</div>

No, nothing there. (My level is far under where I would have made such a mistake! 😀)

Thank you for trying! It was interesting to explore the Julia-client options, so I got something out of it…

---

<div class="post-metadata">

**Author:** ![pfitzseb](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pfitzseb/32/45566_2.png) [@pfitzseb](https://discourse.julialang.org/u/pfitzseb)\
**Post date:** [May 22, 2020, 10:53am UTC](https://discourse.julialang.org/t/fail-to-execute-startup-jl/39936/12 "2020-05-22T10:53:55Z")

</div>

As a more immediate solution you could also put your code into `juno_startup.jl` (can be opened with `Julia: Open Juno Startup File`) and see if that works.

---

<div class="post-metadata">

**Author:** ![Philippe\_Maincon1](https://avatars.discourse-cdn.com/v4/letter/p/ec9cab/32.png) [@Philippe\_Maincon1](https://discourse.julialang.org/u/Philippe_Maincon1)\
**Post date:** [May 22, 2020, 10:55am UTC](https://discourse.julialang.org/t/fail-to-execute-startup-jl/39936/13 "2020-05-22T10:55:34Z")

</div>

No joy…

---

<div class="post-metadata">

**Author:** ![pfitzseb](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pfitzseb/32/45566_2.png) [@pfitzseb](https://discourse.julialang.org/u/pfitzseb)\
**Post date:** [May 22, 2020, 10:58am UTC](https://discourse.julialang.org/t/fail-to-execute-startup-jl/39936/14 "2020-05-22T10:58:30Z")

</div>

That’s really weird. Can you share the content of your `startup.jl`?

---

<div class="post-metadata">

**Author:** ![Philippe\_Maincon1](https://avatars.discourse-cdn.com/v4/letter/p/ec9cab/32.png) [@Philippe\_Maincon1](https://discourse.julialang.org/u/Philippe_Maincon1)\
**Post date:** [May 22, 2020, 11:01am UTC](https://discourse.julialang.org/t/fail-to-execute-startup-jl/39936/15 "2020-05-22T11:01:25Z")

</div>

```julia
#Used by Julia 1.0 and beyond
using Printf
#using Revise
@printf "Executing %s\n" @ __FILE__
const home = "C:\\Users\\myuser\\Documents\\GIT\\julia"
add2path(s) = (push!(LOAD_PATH, s);@printf "Added to path : %s\n" s)

add2path("$home\\modules_1_0\\src")

#rm(abspath(first(DEPOT_PATH), "conda", "deps.jl"))
cd("$home\\sandbox"); @printf "Set current dir : %s\n" pwd()
@printf "Completed %s\n\n" @ __FILE__

```

…but again, I have replaced the code with `println("startup")` and it does not seem to execute, so I do not see how that could be my code…

---

<div class="post-metadata">

**Author:** ![ciyer](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ciyer/32/16288_2.png) [@ciyer](https://discourse.julialang.org/u/ciyer)\
**Post date:** [July 10, 2020, 12:09pm UTC](https://discourse.julialang.org/t/fail-to-execute-startup-jl/39936/16 "2020-07-10T12:09:05Z")

</div>

Just wanted to add that I am experiencing this exact same behavior using Julia 1.4.2 on Linux.

Following the instructions here: [Getting Started · The Julia Language](https://docs.julialang.org/en/v1/manual/getting-started/index.html) . According to the Getting Started instructions, I should see a message printed when I start Julia, but I do not.

```julia
$ mkdir -p ~/.julia/config/
$ echo 'println("Greetings! 你好! 안녕하세요?")' > ~/.julia/config/startup.jl
$ julia
               _
   _ _ _(_)_ | Documentation: https://docs.julialang.org
  (_) | (_) (_) |
   _ _ _| |_ __ _ | Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` | |
  | | |_| | | | (_| | | Version 1.4.2 (2020-05-23)
 _/ |\ __'_|_|_|\__'_| | Official https://julialang.org/ release
|__/ |

```

Julia is installed using [https://julialang-s3.julialang.org/bin/linux/x64/1.4/julia-1.4.2-linux-x86\_64.tar.gz](https://julialang-s3.julialang.org/bin/linux/x64/1.4/julia-1.4.2-linux-x86_64.tar.gz)

---

<div class="post-metadata">

**Author:** ![Philippe\_Maincon1](https://avatars.discourse-cdn.com/v4/letter/p/ec9cab/32.png) [@Philippe\_Maincon1](https://discourse.julialang.org/u/Philippe_Maincon1)\
**Post date:** [August 4, 2020, 10:00am UTC](https://discourse.julialang.org/t/fail-to-execute-startup-jl/39936/17 "2020-08-04T10:00:08Z")

</div>

I have been digging further into this. In ended up editing

> C:\Users\THATSME\AppData\Local\JuliaPro-1.4.1-1\Julia-1.4.1\etc\julia\startup.jl # systemwide startup file

and hardcoding a call to my personal startup file

> include(“C:\Users\THATSME\.julia\config\startup.jl”)

I’ll probably get a prize for the ugliest workaround.

---

<div class="post-metadata">

**Author:** ![dwarfmaster](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dwarfmaster/32/33242_2.png) [@dwarfmaster](https://discourse.julialang.org/u/dwarfmaster)\
**Post date:** [January 27, 2022, 1:36pm UTC](https://discourse.julialang.org/t/fail-to-execute-startup-jl/39936/18 "2022-01-27T13:36:53Z")

</div>

I had the same problem and it turns out that julia is looking for the config file in `DEPOT_PATH`, so if you’ve set this variable to anything else than `C:\Users\THATSME\.julia` it won’t find the startup file there. I agree that the documentation should be changed to reflect that.

---

<div class="post-metadata">

**Author:** ![Philippe\_Maincon1](https://avatars.discourse-cdn.com/v4/letter/p/ec9cab/32.png) [@Philippe\_Maincon1](https://discourse.julialang.org/u/Philippe_Maincon1)\
**Post date:** [January 28, 2022, 6:21am UTC](https://discourse.julialang.org/t/fail-to-execute-startup-jl/39936/19 "2022-01-28T06:21:12Z")

</div>

Aha, it sounds very much to me like you solved the problem.  
Now as you see, 1 year passed since I had the problem. When I moved on to newer versions of Julia, the problem disappeared. Probably the new installer corrected the configuration.

Thank you! 😀
