Step 1: Download the JDK
Visit the official website:
Oracle Official Java Download Page
Click “JDK Download” to download the installer for your environment.
Example: For Windows
Download the installer for Windows (e.g.,jdk-21_windows-x64_bin.exe ).
JDK 24 is a good choice for trying out new features, but it can cause compatibility issues, so we choose JDK 21 as a stabilizer.

Step 2: Install the JDK
Double-click the downloaded installer to run it.
Follow the installer’s instructions and click “Next” to proceed.
The folder where you install it is fine, but make a note of the path just in case
(e.g., ).C:\Program Files\Java\jdk-21
Once the installation is complete, click Close.
Step 3: Set Environment Variables
In the Windows search bar, type “environment variables” and select “Edit system environment variables.”
In the System Properties window, click Environment Variable (N)….

In the System Environment Variables section, click New (N)…, and enter the following:
Parameter Name:JAVA_HOME
Variable value: JDK installation path (e.g.C:\Program Files\Java\jdk-21

Click OK to save the settings.
In the System Environment Variables section, select Path and click Edit (E)….

Click New (N) and%JAVA_HOME%\bin add .

Click OK to close all windows.
Step 4: Confirm the installation
- Type cmd in the Windows search bar and open a new Command Prompt.
- Enter the following command to verify that the Java version information is displayed:
java -versionYou are now done installing Java (JDK) and setting up environment variables.
Comments