Java is a versatile programming language that has been around for several decades and is still in use today. In our previous article, we discussed the features, benefits, and drawbacks of Java, and how it can be used to create different types of applications. In this article, we will focus on the installation process of Java on Windows 11. If you are a Windows 11 user who is interested in using Java to develop applications, this guide will provide you with step-by-step instructions on how to install and run Java on your computer. We will walk you through the entire process, from downloading and installing Java to running your first Java program. So, let’s get started!
Check Java is install or not?
First of all let’s check that Java is installed or not in your system. For this follows the following steps :
Step 1 : Open the “command prompt” by typing “cmd” in run window.
Step 2 : Once its open, type “java -version” command.
If the above command shows “Java is not recognized as internal or external command, operable program or batch file. That means it might be that java is not installed on your windows or you might forget to Set the Environment variable.
Let’s install it. For installation, follows the following steps :
Step 1 : Open the browser and in this write “java jdk download”.
Step 2 :Now, open the first link Java Downloads | Oracle India i.e. “https://www.oracle.com/java/technologies/downloads/“
Step 3 : When you scroll down in this page, you will find the latest version of Java i.e. JAVA 19 for now. Now, you will see the downloads links for different operating system like Linux, MacOS and Windows. Click on Windows tab then select the link which is given in front of “x64 Installer”. Now, exe file will be downloaded.
Step 4 : Click on this exe file, first of all, you will see the confirmation window (refer the below picture). Click Yes.
STEP 5 : Once you click on “Yes”, then Java JDK installer has been started on your windows. You just need to click “Next” button.
STEP 6 : If you want to change the installation location, then click on “Change…”, otherwise click on “Next”.
Step 7 : Once all the steps are done, then click on “Close” to close this installation window.
Installation is done you will check in your system by going the installation location. However, in my case I was not changing the location, so it will be present in : “C:\Program Files\Java\jdk-19”
Next Step is to SET ENVIRONMENT VARIABLE :
Step 1 : For this, open Control Panel, then click on System, then
System —> Advanced System Setting —> Environment Variable
After that click on “Advanced System Settings” (as per below screenshot)
Step 2 : Now, Select ‘Path’ inside “System Variables” and then click on Edit.
Step 3 : Here, you need to add the Path to your jdk folder binaries. So, go to the folder, copy the path and paste it.
Step 4 : Some applications also need JAVA_HOME environment variable in your operating system. For that you will click on “New…” under “User variable for codebehind” section.
Set variable name as “JAVA_HOME” and put the path of folder where java is installed on your system in “Variable Value”. After that click on OK.
Let’s check again Java is installed or not?
Once the installation is complete, open the Command Prompt by pressing the “Windows + R” key and typing “cmd” in the Run dialog box.
Type “java -version” in the Command Prompt and press Enter. This will display the version of Java that is currently installed on your computer.
Congratulations! You have successfully installed Java on Windows 11.
In conclusion, installing Java on a Windows 11 computer is a relatively simple process. You need to download the latest version of Java SE Development Kit (JDK) from the official Oracle website and follow the on-screen instructions to complete the installation. After installation, you can check the version of Java installed on your computer by running the “java -version” command in the Command Prompt. To run a Java program, you need to write the Java code, compile it using the “javac” command, and then run it using the “java” command. Following these steps, you can easily install and run Java programs on your Windows 11 computer. In the next article, we will guide you on how to write and run a Java program on Windows. Stay tuned!