In order to download and install JDK, you have to open the link to Oracle website and click on the download button, right under JDK (pointed by the mouse pointer in the picture below). Figure 1 Clicking on the download button takes you to a new page, where you are required to - Accept License Agreement,.
In this guide, I’m going to show you exactly how to download and install JDK 10 on Windows.
(Step-by-step)
First, I’ll show you where you can get JDK 1.10.
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 11.
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.
Scroll to the bottom of the page and look for the
Java Archive
section.Click on the
Download
button.Click on the
Java SE 10
link under the Java SE
title.Starting with Java 9, Oracle introduced a new support model. Versions tagged as LTS (long-term support) will receive support for 3 years. Non-LTS versions will be out of support as soon as a new major version is released.
Look for the
Java SE Development Kit 10.0.2
section.Click on the radio button next to
Accept License Agreement
.Click on the Windows download link:
jdk-10.0.2_windows-x64_bin.exe
.Note that as from version 9, Oracle no longer provides 32-bit JDK builds.
To download archived JDK versions you need an Oracle account. Create a new account or sign in with an existing one.
Wait for the download to complete.
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
Click on
Install anyway
.The JDK installer will start. Click
Next
.You can change the installation location by clicking on the
Change…
button.In this example, we keep the default install location of
C:Program FilesJavajdk-10.0.2
. From now on we will refer to this directory as [JAVA_INSTALL_DIR]
.We will not install the public JRE as the JDK development tools already include a private JRE.
Select the
Public JRE
dropdown and click on 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.
Once the installation is complete, click
Close
.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.
Click on
New…
.Enter “JAVA_HOME” as variable name. Enter the
[JAVA_INSTALL_DIR]
as variable value.In this tutorial, the Java installation directory is
C:Program FilesJavajdk-10.0.2
.Click
OK
.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…
.Click on
New
and type “%JAVA_HOME%bin” as shown below.Click
OK
.Click
OK
once more to close the environment variables window.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.Wait for the command prompt to open.
Type “java -version” and press
ENTER
.The above command prints the installed JDK version:
10.0.2
.Congratulations, you have installed JDK 10 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!
The type of installation depends on your requirement and the platform that you choose to install.
Installation Requirements and Related Tasks
To develop or run Java applications, download and install JDK.
Version-String Format
To understand the version-string scheme that is used to distinguish various JDK releases, see Version-String Format.
Installation
The JDK can be installed on the following platforms:
You can download JDK from Java SE Development Kit Downloads page.
For supported processors and browsers, see Oracle JDK Certified System Configurations.
The JDK documentation is a separate download. See Java SE Documentation.
Oracle Solaris
Installation of JDK on Oracle Solaris: Instructions include installation from Image Packaging System (IPS) and Archive binaries.
Microsoft Windows
Installation of the JDK on Microsoft Windows Platforms: Instructions include steps to install the JDK on 64-bit Microsoft Windows operating systems.
Linux
Installation of the JDK on Linux Platforms: Instructions include installation from Archive binaries and Red Hat Package Manager (RPM).
macOS
The installation of the JDK 12 requires macOS 10.11 or later.
Installation of the JDK on macOS: Instructions include steps to install the JDK on the macOS platform.
To learn about the files and directories that are created after JDK installation, see Installed Directory Structure of JDK.