This post shows students and new users steps to install Oracle Java JDK on Windows 11. For anyone building Java based applications, they’re going to be using the Java programming language. Java language is popular and in almost all operating systems.
To build and use Java applications in Windows 11, you’ll need to install Java JDK. The JDK includes tools for developing and testing programs written in the Java programming language and running on the Java platform.
Below are steps that one can take to download, install and add Java executables to Windows PATH environment variables.
How to download and install Java JDK in Windows 11
As mentioned above, in order to build a develop Java programs in Windows, you’ll need Java JDK installed. The steps below show you how to do that.
First, go and download Java JDK package from the link below.
Oracle Java Downloads
On the download page, choose the Java JDK Windows installer (.EXE) and download.
Once downloaded, go to your Downloads folder and run the JAVA executable (jdk-17_windows-x64_bin).
When you double-click the installer, it should launch the Windows installer to install Java. When prompted, click Next to continue.
Accept the default installation option, including the path. By default, Java is installed in the C:\Program Files\Java\jdk-version-number.
At the end of the installation, click Close.
Java is installed correctly. Now, follow the next step to configure environment variables for Java.
As you can see, Java home folder is at C:\Program Files\Java\jdk-17.0.1. This is not a standard execution path in Windows. You’ll have to add JAVA HOME to the PATH environment variable to be able to use Java effectively.
How to add Java to the PATH environment variables in Windows 11
By default, most programs will add their own custom shortcuts to Windows PATH environment variables.
Some programs will not automatically add to the System Path variables, but will let users edit or add to the path so that the program can function correctly.
All about Windows PATH Environment Variables can be found at the link below:
How to add or edit Windows PATH environment variables in Windows 11
To add add JAVA to the PATH environment, open Environment Variables from the System Properties ==> Advanced tab.
On the Environment Variables properties window, under System variables, click the New button.
Type JAVA_HOME in Variable name field, and type the path where Java is located in the Variable value field. Then click OK.
Next, select the Path variable under System variable, and click Edit. Conform that a variable path for Java is included as highlighted in the image below.
If not, you may have to add a new variable for Java. Typically, you’ll create a new variable with the value below:
After all steps above, open the command prompt console, then type the commands below:
java -version javac -version
You should get similar lines as below:
java version "17.0.1" 2021-10-19 LTS Java(TM) SE Runtime Environment (build 17.0.1+12-LTS-39) Java HotSpot(TM) 64-Bit Server VM (build 17.0.1+12-LTS-39, mixed mode, sharing)
That should do it!
This post shows you how to install and configure JAVA in Windows 11. If you find any error above or have something to add, please use the comment form belowl