Skip to content

Instantly share code, notes, and snippets.

@mfelsche
Created May 5, 2014 14:03
Show Gist options
  • Save mfelsche/200fb4683636b62b9e9c to your computer and use it in GitHub Desktop.
Save mfelsche/200fb4683636b62b9e9c to your computer and use it in GitHub Desktop.
java7 and java8 side by side on OSX
# JAVA7
export JAVA_HOME="`/usr/libexec/java_home -v '1.7.*'`"
# JAVA 8
# create aliases suffixed with 8 for every java8 executable
export JAVA8_HOME=`/usr/libexec/java_home -v'1.8.*'`
for JAVA8_BIN in `ls ${JAVA8_HOME}/bin/*`
do
alias `basename ${JAVA8_BIN}`8=${JAVA8_BIN}
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment