leiningen

valtteri 2025-03-23T14:04:19.911119Z

Today I encountered something I didn't understand. I have an uberjar which I start with java -jar backend.jar . I have an nrepl server running on the backend so I can REPL in prod. To my surprise when I evaluate (get (System/getenv) "LEIN_VERSION") it returns the version. This env var is NOT present in the environment. What could be setting it?

Evan Bernard 2025-04-01T15:21:34.491349Z

could that REPL be running under a different session as the running process, and maybe the REPL process/lein uses export(1) to put that var into the session on startup of the REPL?

gaverhae 2025-06-13T11:23:31.931749Z

How did you determine that this env var is not set in the environment? Last I checked the JVM was unable to change its own environment.

valtteri 2025-06-13T13:36:44.419079Z

I ran bash in that container and checked output of env

valtteri 2025-06-13T13:37:51.643599Z

(if I remember correctly… it was a while ago.. )

gaverhae 2025-06-13T14:41:47.428429Z

Yeah, sorry for reviving this. Is this still worth investigating or have you moved on?

valtteri 2025-06-13T14:44:52.678459Z

I’ve migrated to deps.edn since.. and it was not a problem really, I was just confused. 🙂