You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

669 B

Change default Java version on macOS 11 BigSur

javahome() {
  unset JAVA_HOME 
  export JAVA_HOME=$(/usr/libexec/java_home -v "$1");
  java -version
}

alias j1.8='javahome 1.8'
alias j11='javahome 11'
alias j14='javahome 14'
alias j15='javahome 15'

javahome function and aliases in action:

asciicast

See also Change default Java version on macOS 11 BigSur & persist it on lotharschulz.info