How do I install Java on Mac OSX allowing version switching?

后端 未结 10 835
暖寄归人
暖寄归人 2020-12-22 14:37

I want to install OpenJDK Java on Mac OSX and have it work alongside other JDK\'s since it is a newer release. Currently, I downloaded the tar.gz and placed it in my path b

10条回答
  •  既然无缘
    2020-12-22 15:01

    Another alternative is using SDKMAN! See https://wimdeblauwe.wordpress.com/2018/09/26/switching-between-jdk-8-and-11-using-sdkman/

    First install SDKMAN: https://sdkman.io/install and then...

    1. Install Oracle JDK 8 with: sdk install java 8.0.181-oracle
    2. Install OpenJDK 11 with: sdk install java 11.0.0-open

    To switch:

    • Switch to JDK 8 with sdk use java 8.0.181-oracle
    • Switch to JDK 11 with sdk use java 11.0.0-open

    To set a default:

    • Default to JDK 8 with sdk default java 8.0.181-oracle
    • Default to JDK 11 with sdk default java 11.0.0-open

提交回复
热议问题