Some Practical Clojure Examples
← prev | next →     Top-level ToC     /environment-variables.html     (printable version)

To get the value of an environment variable:

(System/getenv "HOME")  ;=> "/home/you"

You can set environment variables on your system in the usual way (in ~/.profile with export FOO=something), or you can set it just for one run:

$ FOO=42 lein run

or, after creating an uberjar of your app:

$ FOO=42 java -jar my-app-0.1.0-standalone.jar