Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to update the java env settings? #17

Open
WorldsEndless opened this issue Feb 11, 2017 · 2 comments
Open

How to update the java env settings? #17

WorldsEndless opened this issue Feb 11, 2017 · 2 comments

Comments

@WorldsEndless
Copy link

This isn't a cprop problem, but I think this might be the best place to get a simple answer. I want to use env vars in my app, hence cprop; however, once I add something to my bashrc and source it, I still don't seem to see it in any clojure app until I've restarted my entire system; I've tried restarting the REPL, restarting the shell, closing down all java apps, etc, and none of these pulls in the vars. Surely I don't need to restart every time to get java to see my new env vars! What do I need to do?

Thanks!

@tolitius
Copy link
Owner

your expectation is perfectly correct: env changes in the same terminal should be picked up:

say we have these two files, config and overrides:

[/tmp]$ cat config.edn
{:foo {:bar-baz "OVERRIDE ME"}}

[/tmp]$ cat overrides.sh
export FOO__BAR_BAZ=42

trying to load config without previously sourcing the overrides:

[/tmp]$ boot repl
boot.user=> (set-env! :dependencies '[[cprop "0.1.10"]])
boot.user=> (require '[cprop.core :as c])
boot.user=> (c/load-config :file "/tmp/config.edn")

read config from file: "/tmp/config.edn"
{:foo {:bar-baz "OVERRIDE ME"}}

boot.user=> Bye for now!

sourcing overrides and trying again:

[/tmp]$ source overrides.sh

[/tmp]$ boot repl
boot.user=> (set-env! :dependencies '[[cprop "0.1.10"]])
boot.user=> (require '[cprop.core :as c])
boot.user=> (c/load-config :file "/tmp/config.edn")

read config from file: "/tmp/config.edn"
{:foo {:bar-baz 42}}

One thing to check after you sourced your env file is whether the shell actually sees your variable(s):

[/tmp]$ env | grep FOO
FOO__BAR_BAZ=42

@WorldsEndless
Copy link
Author

Would there be any difference in my using lein run or just cider-jack-in instead of lein repl or boot repl?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants