Fail to execute startup.jl

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

1 Like

It should be

~/.julia/config/startup.jl

See Getting Started · The Julia Language

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?

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):

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.

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.

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

…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?

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

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

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?

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

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

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.

No joy…

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

#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…

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 . According to the Getting Started instructions, I should see a message printed when I start Julia, but I do not.

$ 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

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.

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.

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! :grinning: