How to Download and Install JDK 11 on Windows

3 minute read

download install jdk 11 windows

In this guide, I’m going to show you exactly how to download and install JDK 11 on Windows.

(Step-by-step)

First, I’ll show you where you can get JDK 11.0.1.

Then you’ll see how to configure it.

And finally how to verify if everything is working.

Let’s dive right in…

Check following post if you are looking to download and install JDK 1.5, JDK 1.6, JDK 1.7, JDK 1.8, JDK 9 or JDK 10.

What is a JDK?

When you want to create a Java application you need a Java Development Kit (JDK). It contains tools that allow you to develop and run your Java program.

what is a jdk

One of these development tools is a compiler (javac) that converts Java source code (.java files) into Java bytecode (.class files). Other tools include an archiver (jar) and a documentation generator (javadoc).

The JDK also contains a Java Runtime Environment (JRE) that is able to run compiled Java code. To do this the JRE uses Java libraries and a Java Virtual Machine (JVM) that executes the compiled Java code.

Different JDK implementations are available. The official reference implementation is maintained by Oracle.

Important: as of Java 11, Oracle has changed the license of their JDK. Instead of having a single JDK build which you can use for free, they now have two different JDK builds:

  • Oracle’s JDK (commercial) – you can use this in development and testing for free, but if you use it in production you have to pay for it.
  • Oracle’s OpenJDK (open source) – you can use this for free in any environment.

We will install the free version in this guide as Oracle’s JDK and OpenJDK are functionally the same.

Step #1: Download

Head over to the Oracle OpenJDK download page.

Look for the builds section.

Click on the zip link right next to Windows/x64.

At the time of writing the latest Oracle OpenJDK release was version: 11.0.1.

jdk 11 download java se

Note that as from version 9, Oracle no longer provides 32-bit JDK builds.

Wait for the download to complete.

Step #2: Install

Open the location of the downloaded binary.

jdk 11 downloaded binary

Select the ZIP archive file. Right-click and then click on the Extract All… menu item.

jdk 11 downloaded binary extract all

Select an extract destination for the JDK files.

In this example, we extract in C:\Users\Downlinko\tools\jdk.

Click on Extract.

jdk extract destination

This extracts all JDK files under C:\Users\Downlinko\tools\jdk\jdk-11.0.1.

From now on we refer to this location as [JAVA_INSTALL_DIR].

jdk 11 install dir

Step #3: Setup

We need to set up an environment variable that will point to our JDK installation.

Click on the search button. Then type “env” (without quotes).

On Windows 7 click on the Windows button.

Click on the Edit environment variables for your account shortcut.

windows search env

Wait for the environment variables window to open.

Click on New….

windows account environment variables new

Enter “JAVA_HOME” as variable name. Enter the [JAVA_INSTALL_DIR] as variable value.

In this tutorial, the Java installation directory is C:\Users\Downlinko\tools\jdk\jdk-11.0.1.

Click OK.

jdk 11 home variable

Next, we need to configure the PATH environment variable so we can run Java from a command prompt.

Select the Path variable. Click on Edit….

jdk 11 edit path variable

Click on New and type “%JAVA_HOME%\bin” as shown below.

Click OK.

jdk edit path variable add java home

Click OK once more to close the environment variables window.

jdk 11 windows account environment variables

If a Path variable does not exist you need to create it. Use “Path” as variable name and “%JAVA_HOME%\bin” as variable value.

On Windows 7 you cannot add extra values for an existing Path variable. You need to append “;%JAVA_HOME%\bin” at the end of the variable value instead.

Step #4: Test

Let’s test the setup.

Click on the search button. Then type “cmd” (without quotes).

Click on the Command Prompt shortcut.

windows search cmd

Wait for the command prompt to open.

Type “java -version” and press ENTER.

jdk version command

The above command prints the installed OpenJDK version: 11.0.1.

jdk 11 version output

Congratulations, you have installed JDK 11 on Windows 10!

Now take the next step and write your first Java program.

Let me know if you liked this post.

Leave a comment below.

Thanks!

Leave a comment