How to Install JDK on Windows Server 2022
If you want to run any Java program on your Windows , you won’t be able to do it without installing the Java Development Kit (JDK for short).
The JDK also contains the Java Runtime Environment (or JRE) which is the core of a Java program.
If you are a beginner trying to learn how to run Java programs in your Windows operating system, then you might face difficulties installing Java correctly on your computer. But fear not! I will cover everything you need to know to prepare your Windows computer fully for running Java programs.
I will be using Windows 2022 in this article, but the same method is applicable for the other versions of the Windows operating system as well.
1. How to download Java JDK from Oracle (LTS)
We download the official JDK directly from the official website of Oracle. So, go to their website: https://www.oracle.com/
You might get this type of prompt to remind you to go to the country closer to you so that you can get a better downloading speed. As I am from Hong Kong, so it is suggesting that I visit Oracle Hong Kong
You can select the country closer to you to get a better download speed, but if you do not want that and just download from the global site instead, that’s fine, too. You will get the exact installer file from there as well. Then the website might reloaded itself
- Click on Products.
- Then click Java.
- It will take us to the product page of Java. Click Download Java.
- Then you will get the download page simply scroll down a little until you get the OS (Operating System) selection tab. Since you want to install Java on your Windows computer, simply click Windows.
- Then Click x64 Installer. You will get a prompt to download the installer file,download the executable file. You’ll need to wait a little while for it to complete the downloading process.
2. How to download Java JDK
- After the download is complete, please click on the installer to begin the process. This is a very simple process, just click Next on the first two screens to start it.
- After a few minutes, the installation will be complete. Please press Close to exit the wizard.
3. Configuring JDK on Windows Server 2022
Well, now JDK 20 is installed in the system. However, some modifications are necessary for its proper functioning. In the first place, it is necessary to edit the environment variables. The reason for this is that the JDK installer does not add the folder where it is installed to the set of paths where Windows look for its executable programs. Consequently, the operating system will not be able to find the JDK components. So we will have to do this configuration manually. But don’t worry, we’ll tell you how to do it. The first thing to do is to press the Win+R combination and run the next line:
- Then, from the Advanced tab, click on Environment Variables.
- Then click on Path and then on Edit.
- A window will immediately pop up. Please click on Edit Text.
- Copy the exact address from the installation directory
Go to the directory where you have installed the installer earlier. In this case, the default directory is always the C drive.
After going into the C drive, go into the Program Files > Java > JDK-20 > bin .The binary files are kept here.
- We need to copy the directory path (directory address) of this folder.
- Please continue with the installation
We return to the point of editing the text of the Path variable. Please note that you should not delete the current variable. In fact, you only have to add the previously copied address. Attention! You have to be very careful to add the variable after the ;
- Back to the previous screen, check the modification. Press OK to continue
Then close all the windows by pressing OK.
4. Checking the operation of the JDK
To verify that the software has been successfully installed please open a Command Prompt. Once there, run the following command:
Java SDK correctly installed and configured on Windows Server 2022
I hope this article helps you install Java on your Windows operating machine.