Skip to content

Installing and Verifying Java/JDK

writing-sample

To finish this tutorial, you need Amazon Coretto Java/JDK version 11.

Install Java/JDK

To install Java/JDK 11, open a terminal window and:

  1. Check the version availability by typing, sdk list java | grep "11.*amzn". The output results should look similar to the following:

    |  | 11.0.16  | amzn |  | 11.0.16-amzn
    
  2. If you don't have v11, download and install it by typing, sdk install java 11.0.16-amzn.

  3. Set the version to 11 by typing, sdk default java 11.0.16-amzn.

Verify Java/JDK

After installation, verify that you have the correct version Java/JDK version (V11). To check, open a terminal window and:

  1. Type which java. The output results should look similar to the following:

    /Users/<your_username>/.sdkman/candidates/java/current/bin/java
    
  2. Type java --version. The output results should look similar to the following:

    openjdk 11.0.16 2022-07-19 LTS
    OpenJDK Runtime Environment Corretto-11.0.16.8.1 (build 11.0.16+8-LTS)
    OpenJDK 64-Bit Server VM Corretto-11.0.16.8.1 (build 11.0.16+8-LTS, mixed mode)