Did you know you can install Java on Windows 11? Yes, Java SE version 16.01 and later is fully compatible with Windows 11 and with few easy steps, you can install the Java on Windows 11.
Java is one of the widely used programming languages, and many applications available today are written in Java. Java is a high level, robust, object-oriented and secure programming language. It is used as the server-side language for most back-end development projects.
If you recently purchased a new laptop that came pre-installed with Windows 11, you can manually install Java and start programming. If you are running Windows 10 and are planning to upgrade to Windows 11, Java SE version 16.01 and above are fully compatible with Windows 11.
In this article, we will cover some important aspects such as downloading Java, installing Java on Windows 11 and determining if the Java is installed along with version.
If you want to deploy Java to multiple computers in your setup, you can use SCCM to deploy Java. Configuration Manager makes it really easier for admins to deploy applications and manage software updates.
Download Java for Windows 11
So, which version of Java should you download for Windows 11? The answer is the latest of Java must be downloaded. If you are a beginner, you can download the latest available Java SE Development Kit from Oracle downloads site.
To download the latest version of Java, go to Oracle Download page. The Java SE Development Kit 17.0.1 downloads are available for Windows, Linux, macOS.
Since we are going to install Java on Windows 11, select the Windows tab and download either the Java x64 installer or Java x64 MSI installer.
At the time of writing this article, the latest available Java SE Development kit is version 17.0.1. Newer versions of Java will be released every year, however the installation procedure for Java on Windows 11 will remain the same.
Save the Java installer on your Windows 11 PC. In the next section, we will determine if the Java is already installed on the computer and then look at installation steps for Java.
Check if Java is Installed on Computer
Before you install Java on Windows 11 PC, you can actually check if the Java is already installed.
Launch the Command Prompt as administrator and run the command
java -version. The java -version command checks if the java is installed on the computer.
If the command output shows ‘java’ is not recognized as an internal or external command, operable program or batch file, it means the Java is not installed on the computer.
How to Install Java on Windows 11
Let’s look at the steps to install Java on a Windows 11 PC. Right-click the Java Installer and select Open. The installer extracts the files required for the setup.
On the Java SE Development kit 64-bit setup window, click Next.
The Java installs on Windows 11 in the following folder path –
C:\Program Files\Java\jdk-version-number\. Although you can change the default Java installation path but let’s proceed with default path. Click Next to continue.
Within few seconds, the Java installs on Windows 11. The message Java SE Development Kit 64-Bit successfully installed confirms the Java is installed on Windows 11. Click Close.
This completes the installation of Java on Windows 11 PC. You don’t have to reboot your PC after installing Java.
Now that Java is installed on Windows 11 PC, let’s run the
java -version command and determine the exact version of Java.
Configure Environment Variables for Java
In this section, you’ll learn how to configure the environment variables for Java. Environment variables are values that impact the processes and behavior of running computer systems and OS environments.
On Windows 11 PC, the Java installation files are located in
C:\Program Files\Java\jdk-version-number\ folder. You need this path while configuring environment variable for Java. We’ll define this path as our JAVA_HOME environment variable now.
Open Windows 11 start Menu and type environment variables. From the results, select Edit the system environment variables.
On the System Properties window, select the Advanced tab and select Environment Variables.
The Environment Variables window displays the user variables and system variables present on Windows 11 PC. When you install Java on Windows 11, you’ll notice a variable that is created by the installer.
To create a new system variable, click New.
In the New System Variable window, define the following:
- Variable name: JAVA_HOME
- Variable path: C:\Program Files\Java\jdk-version
Click OK twice to save the new system variable.
Now launch the command prompt and run the command,
echo %JAVA_HOME% and this command should return the Java installation files path (or the variable path that we defined above).
After you install the java on Windows 11 PC, run the command
java -version. If the Java is installed, the output should look something as described 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)
This completes the steps to install Java on Windows 11 PC. If you have any questions or suggestions, you can add them in the comments section below.