Created
March 6, 2018 22:56
-
-
Save MikaelSmith/233615865e9248d03dc4aedceff9b59c to your computer and use it in GitHub Desktop.
Java 8 and 9
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
java8 () { | |
latest=`ls -d /Library/Java/JavaVirtualMachines/jdk1.8.0_*.jdk | sed 's/^.*jdk1\.8\.0_//' | sort -n | tail -1` | |
export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_${latest}Contents/Home | |
java -version | |
} | |
java9 () { | |
export JAVA_HOME=/Library/Java/Home | |
java -version | |
} |
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
# Installs Java 8 alongside Java 9 | |
brew tap caskroom/versions | |
brew cask install java | |
brew cask install java8 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
See http://www.jenv.be/ for an alternative to shell functions.