In this guide, I’m going to show you exactly how to download and install JDK 1.8 on Windows.
First, I’ll show you where you can get JDK 8.
Then you’ll see how to configure it.
And finally how to verify if everything is working.
Let’s dive right in…
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.
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.
Step #1: Download
There are several Java platforms. In this tutorial, we will install the Java Standard Edition (SE).
Head over to the Oracle Java download page.
Look for the
Java SE 8u191 / Java SE 8u192 section.
Click on the
Download button right below
Click on the radio button next to
Accept License Agreement.
Verify your windows bit version and click on the corresponding link:
- For 32-bit = Windows x86 installer
- For 64-bit = Windows x64 installer
In this guide, we will download the 64-bit installer:
Wait for the download to complete.
Check the Java Archive section for older versions like JDK 1.8.0_131, 1.8.0_144, 1.8.0_172 or 1.8.0_181
Step #2: Install
Open the location of the downloaded executable.
Double-click it to run the installer.
On Windows 10 a pop-up window will appear:
The app you're trying to install isn't a verified app from the Store
The JDK installer will start. Click
You can change the installation location by clicking on the
In this example, we keep the default install location of
C:\Program Files\Java\jdk1.8.0_191. From now on we will refer to this directory as
We will not install the public JRE as the JDK development tools already include a private JRE.
Public JRE dropdown and click on
This feature will not be available. as shown below.
Next to start the installation.
The JDK installation will now start.
A progress bar shows the various steps that are executed.
Once the installation is complete, click
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.
Wait for the environment variables window to open.
Enter “JAVA_HOME” as variable name. Enter the
[JAVA_INSTALL_DIR] as variable value.
In this tutorial, the Java installation directory is
Next, we need to configure the PATH environment variable so we can run Java from a command prompt.
Path variable. Click on
New and type “%JAVA_HOME%\bin” as shown below.
OK once more to close the environment variables window.
Pathvariable 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
Pathvariable. 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.
Wait for the command prompt to open.
Type “java -version” and press
The above command prints the installed JDK version:
Congratulations, you have installed JDK 1.8 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.