Created
June 12, 2018 00:28
-
-
Save moinsam/2b0cce23c7d5fc3a9f51f5d813579386 to your computer and use it in GitHub Desktop.
Bash profile for multiple java
This file contains hidden or 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
export JAVA_6_HOME=$(/usr/libexec/java_home -v1.6) | |
export JAVA_7_HOME=$(/usr/libexec/java_home -v1.7) | |
export JAVA_8_HOME=$(/usr/libexec/java_home -v1.8) | |
export JAVA_9_HOME=$(/usr/libexec/java_home -v9) | |
export JAVA_10_HOME=$(/usr/libexec/java_home -v10) | |
alias java6='export JAVA_HOME=$JAVA_6_HOME' | |
alias java7='export JAVA_HOME=$JAVA_7_HOME' | |
alias java8='export JAVA_HOME=$JAVA_8_HOME' | |
alias java9='export JAVA_HOME=$JAVA_9_HOME' | |
alias java10='export JAVA_HOME=$JAVA_10_HOME' | |
#default java8 | |
export JAVA_HOME=$JAVA_8_HOME |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment