Skip to content

Instantly share code, notes, and snippets.

@newhavengill
Last active September 1, 2016 04:24
Show Gist options
  • Save newhavengill/9301072 to your computer and use it in GitHub Desktop.
Save newhavengill/9301072 to your computer and use it in GitHub Desktop.
Add jdk8 and toggle between jdk7 and jdk8
## I'm running Mavericks. No Java and no Maven anymore
## Download jdk8 --> https://jdk8.java.net/download.html
## then add the following to your ~/.profile and source
export JAVA_7_HOME=$(/usr/libexec/java_home -v1.7)
export JAVA_8_HOME=$(/usr/libexec/java_home -v1.8)
export JAVA_HOME=$JAVA_7_HOME
## Command line alias so we can switch to java6 or Java7
alias java7='export JAVA_HOME=$JAVA_7_HOME'
alias java8='export JAVA_HOME=$JAVA_8_HOME'
## If you haven't already, installed maven
## brew update
## brew install maven
## mvn -version
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment