@@ -75,27 +75,40 @@ and a global configuration search path of
75
75
76
76
### ` JULIA_PROJECT `
77
77
78
- A directory path that points to the current Julia project. Setting this
79
- environment variable has the same effect as specifying the ` --project ` start-up
80
- option, but ` --project ` has higher precedence. If the variable is set to ` @. ` then
81
- Julia tries to find a project directory that contains ` Project.toml ` or
82
- ` JuliaProject.toml ` file from the current directory and its parents. See also
78
+ A directory path that indicates which project should be the initial active project.
79
+ Setting this environment variable has the same effect as specifying the ` --project `
80
+ start-up option, but ` --project ` has higher precedence. If the variable is set to ` @. `
81
+ then Julia tries to find a project directory that contains ` Project.toml ` or
82
+ ` JuliaProject.toml ` file from the current directory and its parents. See also
83
83
the chapter on [ Code Loading] ( @ref ) .
84
84
85
85
!!! note
86
86
87
- `JULIA_PROJECT` must be defined before starting julia; defining it in `startup.jl` is too late in the startup process.
87
+ `JULIA_PROJECT` must be defined before starting julia; defining it in `startup.jl`
88
+ is too late in the startup process.
88
89
89
90
### ` JULIA_LOAD_PATH `
90
91
91
- A separated list of absolute paths that are to be appended to the variable
92
- [ ` LOAD_PATH ` ] ( @ref ) . (In Unix-like systems, ` : ` is the path separator; in
93
- Windows systems, ` ; ` is the path separator.) The ` LOAD_PATH ` variable is where
94
- [ ` Base.require ` ] ( @ref ) and ` Base.load_in_path() ` look for code; it defaults to
95
- the absolute path
96
- ` $JULIA_HOME/../share/julia/stdlib/v$(VERSION.major).$(VERSION.minor) ` so that,
97
- e.g., version 0.7 of Julia on a Linux system with a Julia executable at
98
- ` /bin/julia ` will have a default ` LOAD_PATH ` of ` /share/julia/stdlib/v0.7 ` .
92
+ The ` JULIA_LOAD_PATH ` environment variable is used to populate the global Julia
93
+ [ ` LOAD_PATH ` ] ( @ref ) variable, which determines which packages can be loaded via
94
+ ` import ` and ` using ` (see [ Code Loading] ( @ref ) ). Unlike the shell ` PATH ` variable,
95
+ empty entries in ` JULIA_LOAD_PATH ` are expanded to the default value of ` LOAD_PATH ` ,
96
+ ` ["@", "@v#.#", "@stdlib"] ` when populating ` LOAD_PATH ` . This allows easy appending,
97
+ prepending, etc. of the load path value in shell scripts regardless of whether
98
+ ` JULIA_LOAD_PATH ` is already set or not. For example, to prepend the directory
99
+ ` /foo/bar ` to ` LOAD_PATH ` just do
100
+ ``` sh
101
+ export JULIA_LOAD_PATH=" /foo/bar:$JULIA_LOAD_PATH "
102
+ ```
103
+ If the ` JULIA_LOAD_PATH ` environment variable is already set, its old value will be
104
+ prepended with ` /foo/bar ` . On the other hand, if ` JULIA_LOAD_PATH ` is not set, then
105
+ it will be set to ` /foo/bar: ` which will expand to a ` LOAD_PATH ` value of
106
+ ` ["/foo/bar", "@", "@v#.#", "@stdlib"] ` . If ` JULIA_LOAD_PATH ` is set to the empty
107
+ string, it expands to an empty ` LOAD_PATH ` array. In other words, the empty string
108
+ is interpreted as a zero-element array, not a one-element array of the empty string.
109
+ This behavior was chosen so that it would be possible to set an empty load path via
110
+ the environment variable. If you want the default load path, either unset the
111
+ environment variable or if it must have a value, set it to the string ` : ` .
99
112
100
113
### ` JULIA_HISTORY `
101
114
0 commit comments