1.download installation package
(macOS version end with .pkg)
download link
2.install jdk11
open the ‘.pkg’ file
follow the installation prompts to install
3.configuring environment vaiables
open the terminal, run the fllowing command to confirm the installation path
edit ‘~/.zshrc’ or ‘~/.bash_profile’ fileïŒadd the following content
export PATH=$JAVA_HOME/bin:$PATH
save and exit the file, use the following command to make the configuration effective
or
source ~/.bash_profile
4.verify
check ‘JAVA_HOME’ variable
check java version
check javac version