Install Java JDK on Mac

Use a Java JDK version that's compatible with your macOS and processor. All examples in this chapter were developed with Java JDK 8u201.

  1. Open Terminal and enter this command to check if you have Java JDK installed.
    java -version
  2. If one or more Java JDK is installed, confirm that one is compatible with your macOS and processor.
  3. If you need to install Java JDK, go to Java SE 8 Archive Downloads.
  4. In the table, click the macOS tab. Locate and download the install file compatible with your macOS and processor.
  5. Locate and run the downloaded installation file.
  6. After the installation completes, in Terminal enter this command to check that the Java JDK version you picked installed successfully:
    java -version