Skip to content

Instantly share code, notes, and snippets.

@salomvary
Created December 16, 2014 17:55
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save salomvary/b7243165ebfcb53a39f6 to your computer and use it in GitHub Desktop.
Save salomvary/b7243165ebfcb53a39f6 to your computer and use it in GitHub Desktop.
Add all jvms to jenv on Mac
#!/bin/bash
/usr/libexec/java_home -V 2>&1 1>/dev/null |
tail -n +2 |
awk -F $'\t' '{ print $3 }' |
xargs -n 1 jenv add
@salomvary
Copy link
Author

jenv quickstart:

Global:

brew update
brew install jenv
echo 'eval "$(jenv init -)"' >> ~/.bash_profile
./add-all.sh

Per-project:

jenv local 1.8 # only once per project
./sbt # or whatever java command

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment