Installing with Homebrew
-- Updating brew: brew update -- Adding the casks tap: brew tap homebrew/cask-versions -- Adding AdoptOpenJDK (https://adoptopenjdk.net/ and https://github.com/AdoptOpenJDK/homebrew-openjdk): brew tap adoptopenjdk/openjdk -- Looking for java versions: brew search java -- Looking for AdoptOpenJDK versions: brew search jdk -- Checking the details on the java version that will be installed: brew cask info java -- Checking the details on the AdoptOpenJDK version that will be installed: brew cask info jdk -- Installing current version java: brew cask install java -- Installing specific version of AdoptOpenJDK: brew install --cask adoptopenjdk12
Where is my java?
/usr/libexec/java_home -V
Switching java version using .bash_profile:
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) export JAVA_11_HOME=$(/usr/libexec/java_home -v11) export JAVA_12_HOME=$(/usr/libexec/java_home -v12) export JAVA_13_HOME=$(/usr/libexec/java_home -v13) alias java8='export JAVA_HOME=$JAVA_8_HOME' alias java9='export JAVA_HOME=$JAVA_9_HOME' alias java10='export JAVA_HOME=$JAVA_10_HOME' alias java11='export JAVA_HOME=$JAVA_11_HOME' alias java12='export JAVA_HOME=$JAVA_12_HOME' alias java13='export JAVA_HOME=$JAVA_13_HOME' # default to Java 13 java13source: https://stackoverflow.com/questions/52524112/how-do-i-install-java-on-mac-osx-allowing-version-switching
Installing Java17
source: https://java.tutorials24x7.com/blog/how-to-install-openjdk-17-on-mac
Brak komentarzy:
Prześlij komentarz