Install Java 21 on Windows 10

In this article, we will learn how to install Java JDK 21 on Windows 10 OS. With that, to avoid any hassles in the future, we will also let you know how to verify the installation. The following are the steps:

  • Download Java 21
  • Install Java 21
  • Set Java JDK Path (Environment Variable)
  • Verify Java JDK 21 Installation
  • Run Sample Java Program

Let us begin with the 1st step:

Download Java

To download Java, go to Oracle’s official website and click “Download Java“:

Download Java from Oracle's official website

Now, the Downloads page will be visible.

Go to the bottom of the page, and click on the Windows installer as shown below:

Java 18 Download

Install Java

Double-click on the downloaded .exe file:

Java 18 downloaded

Installation begins. Click on Next:

Java 18 Installation started

After clicking Next, the following Destination Folder section is visible. Set the path wherein the Java 18 directories and files will get installed. Keep it the default i.e. here it will install under the following path: “C:\Program Files\Java\jdk-18″. Click on Next:

Destination folder for java installation

The installation continues for some seconds:

Java 18 Installation continues

The installation finishes as in the following screenshot.

Click on Close:

Java 18 installation completed

Now, let us set the JDK path.

Set Java JDK Path (Environment Variable)

First, copy the path wherein you installed the Java JDK. Let us copy it first. Remember, we need to copy the bin path i.e. the following on our system:

Here’s the screenshot of the bin path, wherein we installed Java 18:

Java bin path

To set JDK Path, the easiest way is to type Environment Variables on Start. On typing, the following would be visible: Now, click on Edit Environment Variables,

Environment Variables

A new dialog box would be visible. Now, click Environment Variable:

Click environment variables

Go to the System Variables section and double click Path as in the below screenshot:

Click Path under system variables

Now, the steps are displayed as a list marked in the below screenshot:

  1. On double-clicking Path, a new dialog box will open.
  2. From there, click New,
  3. Add the Java JDK path C:\Program Files\Java\jdk-18\bin as shown below:

Set the Java JDK path

Press Ok. Repeat the same for all the opened dialog boxes.

This ends the installation and the procedure to set the path for JDK. Now, we will verify the JDK installation.

Verify Java JDK Installation

We saw how to install Java JDK  above. We installed it on Windows OS. Now, we can easily verify whether the installation was successful or not using the following command:

Type cmd on START and click to open Command Prompt as shown below:

Open command prompt

Let us implement the above command on command prompt (cmd) and verify Java installation:

Verification of Java 18 installation successful

If the above is visible, that would mean you have successfully installed Java on Windows 10.

In this tutorial, we saw how to install Java on Windows 10. After installation, we also set the JDK path, without which the system won’t run Java programs. In the end, we verified the installation of Java JDK successfully.

Video Tutorial – Java

Here’s the YouTube video for the steps we saw above to install Java on Windows 10:

If you liked the tutorial, spread the word and share the link and our website Studyopedia with others:


For Videos, Join Our YouTube Channel: Join Now


Read More:

How to install Java 16 on Windows 10
Java Comments
Studyopedia Editorial Staff
contact@studyopedia.com

We work to create programming tutorials for all.

No Comments

Post A Comment

Discover more from Studyopedia

Subscribe now to keep reading and get access to the full archive.

Continue reading