This tutorial has everything you need to know about installing JDK 8 on Windows
If you’re new to Java, I’ll show you how to set up the Java Development Kit.
What if you are a Java professional? I will highlight the necessary links that you can use to download the installer.
If you want to get started with Java, you’ll love this tutorial.
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 a cabinet (jar) and a documentation generator (javadoc).
The JDK also contains a Java Runtime Environment (JRE) that is capable of executing compiled Java code. To do this, the JRE uses Java libraries and a Java virtual machine (JVM) that executes the compiled Java code.
There are different JDK implementations available. The official reference implementation is maintained by Oracle.
Please note that Oracle has changed the license of its JDK. Instead of having a single
JDK build that you can use for free, they now have two different JDK builds: Oracle 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 OpenJDK (open source): You can use it for free in any environment
Download Oracle JDK 8 #
Go to the Oracle
Java SE 8 download page.
Look for the Java SE Development Kit 8u331 section.
Check your bit version of Windows and click the appropriate link
😛 ara 32-bit = x86 Windows installer For 64-bit = x64 Windows installer
In this guide, we will download the 64-bit installer: jdk-8u331-windows-x64.exe.
Accept the license pop-up window and click the Download jdk-8u331-windows-x64.exe button.
You will need an Oracle account to download the JDK. Log in with an existing account or create a new account to continue.
Wait for the
download to complete
See the Java file section for earlier versions such as 1.8.0_202
Install Oracle JDK 8 #
Open the location of the downloaded executable
. <img src="/windows-java-8-oracle-jdk-installer-executable_hu24847f8983d10ef5aa9b22c2cabe42ca_39381_640x0_resize_mitchellnetravali_3.png"
Double-click to run the installer
In Windows 10 a pop-up window will appear: The application you are trying to install is not a
Microsoft verified application
Click Install anyway
The JDK installer will start. Click Next.
You can change the installation location by clicking the Change… button.
In this example, we keep the default installation location of C:Program FilesJavajdk1.8.0_331. From now on we will refer to this directory as [JAVA_INSTALL_DIR].
We will not install the public JRE
because the JDK development tools already include a private
Select the public JRE drop-down menu and click This feature will not be available. as shown below.
Click Next to start the installation.
The JDK installation will now start.
A progress bar shows the various steps that are executed.
When the installation is complete, click Close.
Configure Oracle JDK 8#
Now that the JDK is installed we need to configure it.
First we set up an environment variable that will point to our JDK installation.
In the Windows search box, type env.
Click Edit Environment Variables for your account shortcut.
Wait for the environment variables window to open
Enter JAVA_HOME as the variable name. Enter [JAVA_INSTALL_DIR] as the variable value.
In this tutorial, the Java installation directory is C:Program FilesJavajdk1.8.0_331.
Next, we need to set the PATH environment variable so that we can run Java from a command prompt
Select the Path variable. Click Edit….
Click New and type %JAVA_HOME%bin as shown below.
Click OK once again to close the
environment variables window. <img src="/windows-environment-variables-java-8-config_hue40e25f1b99373daa876306b015bc8c4_26877_640x0_resize_mitchellnetravali_3.png"
If a Path variable does not exist, you must create it. Use Path as the variable name and %JAVA_HOME%bin as the variable value.
Test your Oracle JDK 8 installation #
Let’s test the configuration
In the Windows search box, type cmd
Click the Command Prompt shortcut
=”/windows-open-command-prompt_hu03933312859d6e31ea632a07d0d746aa_118752_640x0_resize_mitchellnetravali_3.png” alt=”windows open command prompt” />
Wait for the command prompt to open
Type the following command, and then press ENTER.
The above command prints the installed version of the JDK: 1.8.0_331.
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.