spacemacs

Kira Howe 2021-11-03T22:09:35.038800Z

I have a somewhat random and very environment specific question but hoping I’m just missing something obvious.. I’m wondering how to make emacs automatically/always aware of $JAVA_HOME.. I use jabba to manage JVMs, and $JAVA_HOME is set by default in any new terminal I run, but emacs (spacemacs) is unable to locate a Java runtime by default, until I set it manually

Kira Howe 2021-11-05T22:01:00.044700Z

this is helpful, thank you!

practicalli-johnny 2021-11-04T08:53:57.040400Z

The Jabba readme says it changes the RC file of the shell. So I assume it sets JAVA_HOME to a specific install of Java. Running Emacs command from the terminal should pick up the JAVA_HOME environment variable. However, if running Emacs from a desktop launcher (dock/menu), then I assume the .profile file for your OS account must source the RC file, e.g ~/.bashrc

practicalli-johnny 2021-11-04T08:57:22.040600Z

If JAVA_HOME is changed when Emacs is running, then try reloading environment variables using SPC f e E Note that any running Clojure REPL will need to be restarted (stop/start) to pick up changed environment variables

🙏 1
West 2021-11-04T11:26:50.042300Z

I’ve always used jenv. You can set a local jvm version per directory with a .java-verison file. Emacs (as well as other editors) seems to respect it.