It looks like that lein-environ
plugin isn't actually physically setting environment variables (indeed you can't set environment variables on the current process from within Java - see here for details). Even supposing that it could, ask yourself - how would you ensure that environment variables that were present when building the uberjar are present when it is run?
Rather, lein-environ
and the accompanying environ.core/env
function provide you a way of faking out environment variables for testing and development purposes, without having to manually set environment variables before launching Leiningen. It does this by writing variables provided in the project map to a .lein-env
file from the plugin code, and merging these values with those from the actual operating system environment when calling env
from your project code.
So, when you go to run the uberjar, you'll actually need to have these variables present in your Windows environment (or in a .lein-env
file in your current directory, which I wouldn't recommend). If your goal is to provide a standalone demo using pre-set environment variables to control certain application behavior, I'd create a .cmd
script to distribute with your application that will set the appropriate environment variables and then launch the uberjar.