Mac M1 JAVA环境变量配置

Macbook M1 java环境变量

  1. 下载安装Zulu JDK https://www.azul.com/downloads/zulu-community/?os=macos&architecture=arm-64-bit&package=jdk Mac M1 JAVA环境变量配置_第1张图片

  2. 配置环境变量:sudo vim ~/.zshrc

    # export JAVA_HOME=/Library/Java/JavaVirtualMachines/zulu-8.jdk/Contents/Home
    export JAVA_HOME=/Library/Java/JavaVirtualMachines/zulu-11.jdk/Contents/Home
    
    PATH="$JAVA_HOME/bin:$PATH"
    CLASSPATH="$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar"
    
    export JAVA_HOME
    export PATH
    export CLASSPATH
    

    esc :wq source ~/.zshrc

  3. 验证配置成功:Mac M1 JAVA环境变量配置_第2张图片

  4. 安装IntelliJ免费版运行HelloWorldMac M1 JAVA环境变量配置_第3张图片

你可能感兴趣的:(环境,java,jdk)