01 Amazon Corretto 17 (Java) Install Guide
01 Amazon Corretto 17 (Java) Install Guide
Overview
Amazon Corretto is an open-source distribution of the Java Platform (OpenJDK) which will be used in our course.
i.e. Amazon Corretto is a flavor of OpenJDK provided by Amazon Corporation.
(Screen Shot taken from the Amazon Corretto downloads list web site)
For windows, use the Windows x64 JDK link ending in .msi
Direct Download Link: https://corretto.aws/downloads/latest/amazon-corretto-17-x64-windows-jdk.msi
Installation Guide
Double-click on the downloaded file to run it.
(Images and company logos as presented in this handout are copywrite / trademark their respective owners.)
Click Next
Click Browse and change the default path (C:\Program Files\Amazon Corretto\) to:
C:\AmazonCorretto
Note: Remove the space character between Amazon and Corretto
Write down the installation path you used, if different from the recommended one used here, you may need your path
information later when configuring or troubleshooting system environment variables. (A path starts with a letter like C:
and includes a list of folders separated by backslashes)
Click OK
Note:
The installer will configure the operating system environment variables JAVA_HOME and PATH.
(Optionally you can expand the [+] next to the Setup Environment for more information, but this is not required. If you
do take a look, do not change any settings.)
Instructions on how to manually configure system environment variables can be found at the bottom of this handout.
Click Next
Click Install
You may be asked if you want to give permission for Amazon Corretto to install, grant permission to do so.
A new window will open with a progress bar; wait until the installation is complete
Click Finish
Enter these two commands to verify both the Java Runtime Environment (java), and the Java Compiler (javac) are
responding:
C:\WINDOWS\system32>cd \
C:\>java -version
openjdk version "17.0.3" 2022-04-19 LTS
OpenJDK Runtime Environment Corretto-17.0.3.6.1 (build 17.0.3+6-LTS)
OpenJDK 64-Bit Server VM Corretto-17.0.3.6.1 (build 17.0.3+6-LTS, mixed mode, sharing)
C:\>javac -version
javac 17.0.3
C:\>
(The version number you have will be newer, as of June 21, 2022 it is 17.0.3, as long as the first number is 17 it is okay).
In the upper right corner, change the View-By: dropdown to either Large or Small Icons
Double click on the System Icon
Scroll down to locate the Advanced System settings menu and click.
Select Environment Variables… (Some parts of the system environment variables blurred to protect privacy)
Depending on the software already installed in your system, you will not see the exact items above.
If you have JAVA_HOME, and the Path starts with C:\AmazonCorretto\jdk17.0.3_6\bin; (or a newer version number)
then you are ready to use Java.
If you do not have an entry for JAVA_HOME, or C:\AmazonCorretto\jdk17.0.3_6\bin; in the path then:
Make changes in the System variables portion of the screen, not the User variables
Caution: Do not delete the Path variable either by using Delete, or accidentally while editing it. If in doubt use Cancel
and get help from your lab professor.
If you do not see an entry for JAVA_HOME, use the lower New… button
Enter JAVA_HOME for the Variable Name, and the location of the jdk (Java Development Kit) folder on your hard drive.
Start with windows explorer then copy and paste the path. Tip: Click the address and you can get the path in a format
you can copy.
Example:
Variable name: JAVA_HOME
Variable value: C:\AmazonCorretto\jdk17.0.3_6
Use the folder name that matches your installed version of Amazon Corretto 17.
Click OK
Note that there is a semi-colon at the end of the text above in either case.
In my screen shot the installer added C:\AmazonCorretto\jdk17.0.3_6\bin; as the first part of the path.
Alternatively, you can use %JAVA_HOME%\bin; the %JAVA_HOME% causes windows to look up the value within
JAVA_HOME and place it into the path as needed, i.e. the path will still start with the value inside JAVA_HOME.
In the past, JAVA_HOME was easier to edit as newer versions of Java were installed on the computer, without taking the
risk of editing the Path variable itself.
On an aside, the \bin is a sub-folder that contains all of the binary files i.e. the utility programs for Java like java and
javac (java.exe and javac.exe).
Note: Older versions of Windows only have a single text-box with a very long Path value. Do not delete it all by
accident, edit very carefully using the left and right arrow keys on your keyboard.
With the Path corrected, click OK.
Test (again) to ensure that java and javac work if you made changes.
Note: Close and re-open any Command Prompt windows, they only read the Path environment variable once when they
open. Older Command Prompt windows will not know if the Path was changed.
Tip: Additional Troubleshooting information can be obtained from the console using
echo %JAVA_HOME%
echo %path%
the percent signs are required.
The echo %Path% should report the correct location of the bin folder as the first entry in the Path itself.
Note: If you make changes to the JAVA_HOME and / or Path environment variables, you will need to close and then re-
open the console to check the environment variables again.