Created
August 26, 2014 09:03
-
-
Save tfnico/5fd2dfea556d9a357a55 to your computer and use it in GitHub Desktop.
Set JAVA_HOME to whatever jenv says it is on OS X
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#In my .zshrc: | |
#... | |
# Normal jenv config | |
export PATH="$HOME/.jenv/bin:$PATH" | |
eval "$(jenv init -)" | |
# Now find the JAVA_HOME for it: | |
jenv_java=$(jenv global) # yields 'oracle64-1.6.0.54' | |
echo $jenv_java | |
jenv_java_without_oracle=${jenv_java#*oracle64-} # yields '1.6.0.54' | |
echo $jenv_java_without_oracle | |
export JAVA_HOME=$(/usr/libexec/java_home -v "$jenv_java_without_oracle") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment