Installing Amazon Corretto 21 on Windows 10 or Later
Learning Objectives:
By the end of this lesson, you will be able to:
- Download the correct Amazon Corretto 21 installer for Windows
- Install Amazon Corretto 21 on your Windows system
- Configure essential environment variables for Java development
- Verify the successful installation of Amazon Corretto 21
Let's begin our journey into the world of Java by setting up Amazon Corretto 21. The process involves downloading the installer, running it, and configuring some system settings. Don't worry if this sounds complex – we'll break it down into simple, manageable steps.
First, we need to obtain the Amazon Corretto 21 installer. Open your web browser and navigate to the Amazon Corretto downloads page. Look for the Windows section and download the .msi file for the latest version of Corretto 21. The .msi format is a Windows installer package that makes the installation process straightforward.
Once the download is complete, locate the file in your Downloads folder. It should have a name similar to "amazon-corretto-21.x.x-windows-x64.msi", where x.x represents the specific version number. Double-click this file to start the installation wizard.
The wizard will guide you through the installation process. You'll see a series of screens asking for your preferences. For most users, the default options work well, but let's discuss some key points:
- Installation location: By default, Amazon Corretto 21 installs to
C:\Program Files\Amazon Corretto\
. You can change this if you prefer, but make sure to remember the location you choose. - Features to install: The wizard will show you a list of features to install. For a complete development environment, it's recommended to keep all options selected.
- JDK installation: Ensure that the "JDK" option is selected. This installs the full Java Development Kit, which includes tools you'll need for Java development.
As you progress through the wizard, you may see a security prompt asking if you want to allow the program to make changes to your device. This is normal – click "Yes" to proceed.
After the installation is complete, we need to set up some environment variables. These variables tell your system where to find Java and allow you to run Java commands from any location in the command prompt.
To set up environment variables:
- Right-click on the Windows Start button and select "System".
- Click on "Advanced system settings" on the right side of the window.
- In the System Properties window, click the "Environment Variables" button.
- Under "System variables", click "New" to create a new variable.
- Name the variable
JAVA_HOME
and set its value to the installation directory of Corretto 21. For example:C:\Program Files\Amazon Corretto\jdk21.0.4_7
(adjust the version number if necessary). - Find the "Path" variable in the system variables list, select it, and click "Edit".
- Click "New" and add
%JAVA_HOME%\bin
to the list. - Click "OK" on all open windows to save your changes.
These steps ensure that your system knows where to find Java and can access its tools from any location.
Now, let's verify that the installation was successful. Open a new command prompt (you may need to close and reopen any existing ones for the changes to take effect) and type:
If everything is set up correctly, you should see output similar to this:
This output confirms that Amazon Corretto 21 is installed and ready to use on your system.
Congratulations! You've successfully installed Amazon Corretto 21 on your Windows machine. This Java Development Kit provides you with all the tools you need to start writing, compiling, and running Java programs.
Summary:
In this lesson, we've walked through the process of installing Amazon Corretto 21 on Windows 10 or later. We've covered downloading the installer, running the installation wizard, setting up essential environment variables, and verifying the installation. By following these steps, you've set up a robust Java development environment that will serve you well as you embark on your Java programming journey.