Skip to content

c2.安装Java环境(m1系列芯片)

安装

  • Zulu Java8 jdk下载: Java Download | Java 8, Java 11, Java 13 - Linux, Windows & macOS。 筛选满足arm64架构的安装包:
  • 选择傻瓜dmg,并安装
  • 查看版本 java -version
  • 安装地址为 /Library/Java/JavaVirtualMachines/zulu-8.jdk/Contents/Home
  • .zshrc文件添加环境变量
    • export JAVA_HOME=/Library/Java/JavaVirtualMachines/zulu-11.jdk/Contents/Home
    • 使生效 source ~/.zshrc
bash
  ~ java -version
openjdk version "1.8.0_345"
OpenJDK Runtime Environment (Zulu 8.64.0.19-CA-macos-aarch64) (build 1.8.0_345-b01)
OpenJDK 64-Bit Server VM (Zulu 8.64.0.19-CA-macos-aarch64) (build 25.345-b01, mixed mode)
  ~ java -version
openjdk version "1.8.0_345"
OpenJDK Runtime Environment (Zulu 8.64.0.19-CA-macos-aarch64) (build 1.8.0_345-b01)
OpenJDK 64-Bit Server VM (Zulu 8.64.0.19-CA-macos-aarch64) (build 25.345-b01, mixed mode)

环境变量

bash
export JAVA_HOME=/Library/Java/JavaVirtualMachines/zulu-8.jdk/Contents/Home
export JAVA_HOME=/Library/Java/JavaVirtualMachines/zulu-8.jdk/Contents/Home