How to Install Java on Windows 11

Install Java on Windows 11Install Java on Windows 11

Java is one of the most-used programming languages to date. For that reason, many applications written in Java require the Java Runtime Environment (JRE) to be installed on your Windows 11 computer to be able to run.

This article illustrates how you can install Java on a Windows 11 computer, and how to remove it if and when required. Moreover, it also illustrates how to create the environmental variable for Java in Windows 11.

How to check the Java version on Windows 11

Before we tell you how to install Java, we must first check whether Java is already installed on your computer or not. If so, what is its version?

Follow the steps below to check the installation or version of Java:

  1. Launch the Command Prompt with administrative privileges.
  2. Type in java -version to check whether java is installed on your computer or not.

If the command returns “java is not recognized as an internal or external command, operable program or batch file,” it means that Java is not installed on your system.

not recognized java
Java not installed

However, if it is installed, you will see its version written in the Command Prompt, as in the image below:

java version installed
Java installed

Install Java on Windows 11

Installing Java on your computer is not that difficult. We have discussed how you can install it on your Windows 11 device. However, the process is pretty much the same across all Windows versions.

Java can also be installed on Linux and MacOS platforms, but the packages/files to install it will be different for each platform.

Follow the steps below to install the latest version of Java on Windows 11:

  1. Open the Java downloads page for Windows and click on the download link for x64 Installer.
    download 2
  2. A JDK file will now begin to download (which includes JRE). Once it does, click on it to execute. If prompted with a User Access Control (UAC), click Yes.
  3. The Java installation wizard will now run. Click Next on the first screen.
    j1
  4. On the next screen, click Next again. The installation will now begin at the default path set by the wizard.
    j2
  5. Java installation will be completed within a minute or two. Once it is done, click Close.
    j3

Java should now be successfully installed on your Windows 11 device. You can confirm this by running the java -version command in Command Prompt again, as discussed in the previous section of this post.

Create Environmental Variable for Java on Windows 11

Environmental paths in Windows allow a user for any file to be recognized anywhere within the system. This means you can then execute a .exe file (or any other file) from anywhere within the directory, rather than having to navigate to a directory and only then be able to use it.

Before we begin, you must first know the complete path to where Java’s latest version has been installed as it will be needed later when configuring the environmental variable. The installation path by default is C:\Program Files\Java\JavaVersion (where JavaVersion is a folder named with the Java version). Since we have installed JDK 17.0.1, the complete path for Java on our device is C:\Program Files\Java\jdk-17.0.1:

path
Java installation path

Now that you know the complete path, follow the guide below to create a Java environmental path:

  1. Open the System Properties window on your computer by typing in sysdm.cpl in Run.
    run
  2. In the System Properties window, switch to the Advanced tab and then click the Environment Variables button at the bottom.
    advanced tab
  3. Now click on New under the System variables window.
    new system variable
  4. In the New System Variable window, enter the following corresponding details:
    Variable Name: JAVA_HOME
    Variable Value: C:\Program Files\Java\jdk-17.0.1
    name and path
    Variable Name is the path to the installation folder determined earlier. Click OK when done.
  5. Click OK again on the Environmental Variables as well as the System Properties window to close them.

You have now successfully created the Java environmental variable on your Windows 11 device. You can further manipulate this variable by changing the Variable Value to run an older version of Java (if already installed).

Furthermore, you can also delete the variable by selecting it from under the System Variables list in the Environmental Variables window and then clicking Delete.

delete 2
Delete Java Environmental Variable

How to Uninstall Java on Windows 11

You can also remove Java from your Windows 11 device just as easily, if and when you no longer need it. Here’s how:

  1. Open the Programs and Features page in the Control Panel by typing in appwiz.cpl in Run.
  2. Now double-click the Java Development Kit that you want to remove from your device. If prompted for a confirmation, click Yes.
    delete yes

Java will now remove itself from your computer with no restart required.

FAQs

Can Java be installed on Windows 11?

Yes, Java is fully compatible with Windows 11.

Where is Java installed?

The default location for the Java installation is C:\Program Files\Java

Is it safe to uninstall Java?

Yes, removing Java from your device will have no negative effect. However, it is not recommended as most apps and programs need Java to run.

How to install Java without signing in to Oracle?

You can head directly to the Oracle download page on the following link and download Java without having to sign in:
https://www.oracle.com/java/technologies/downloads/

What is the difference between JDK and JRE?

JRE is a piece of software that is installed on your computer that allows you to run applications developed in Java on your device, whereas JDK is a development kit used by developers. JDK includes both JRE and JVM.

If you liked this post, Share it on:
Subhan Zafar is an established IT professional with interests in Windows and Server infrastructure testing and research, and is currently working with Itechtics as a research consultant. He has studied Electrical Engineering and is also certified by Huawei (HCNA & HCNP Routing and Switching).

Leave the first comment

Get Updates in Your Inbox

Sign up for the regular updates and be the first to know about the latest tech information

Talk to us now

Talk to us straight and get your questions answered right away

Tell Us About Your Project