How to Download and Install Java 16
In this article, we will explain how to Download and Install Java 16.
1. Introduction
Oracle released JDK 16 on March 16, 2021. Let’s see how to download and install Java 16 (Oracle JDK 16).
2. Download Oracle JDK 16
In this step, I will download the installer from the Oracle website. First, open a web browser and navigate to https://www.oracle.com/java/technologies/javase-jdk16-downloads.html. Select the desired file based on the operating system. For this step, I chose the Windows 64 installer and accepted the license agreement.
After clicking the “Download jdk-16.0.1_windows-x64_bin.exe” button, you should find the installer file at the Downloads folder.
3. Install Oracle JDK 16
In this step, I will install Oracle JDK 16 by clicking jdk-16.0.1_windows-x64_bin.exe. It will launch the following Setup dialog.
Click the “Next” button. You may click the “Change” button to change the installation folder location.
Click the “Next” button, it will display the following confirmation dialog in the end.
Click the “Close” button to complete the installation processes.
3.1 Verify Installation
In this step, I will verify the installation by checking the java -version command’s output.
java -version
C:\Users\Zheng>java -version java version "16.0.1" 2021-04-20 Java(TM) SE Runtime Environment (build 16.0.1+9-24) Java HotSpot(TM) 64-Bit Server VM (build 16.0.1+9-24, mixed mode, sharing) C:\Users\Zheng>
The above output confirms that the JDK 16 is installed successfully.
4. Install JDK via Docker
Oracle has not released the JDK 16 docker image yet, but there are other JDK 16 docker image available from DockerHub. In this step, I will get the adoptopenjdk/openjdk16 image and install it in a Docker container.
docker pull adoptopenjdk/openjdk16
C:\MaryZheng\DockerImages>docker pull adoptopenjdk/openjdk16 Using default tag: latest latest: Pulling from adoptopenjdk/openjdk16 c549ccf8d472: Pull complete e5d238d336d9: Pull complete 274767321e8f: Pull complete Digest: sha256:0848d89e17bb1266d187629f934ce325c24af1cdca816f2d25c7ea2bf2c3105e Status: Downloaded newer image for adoptopenjdk/openjdk16:latest docker.io/adoptopenjdk/openjdk16:latest
docker run adoptopenjdk/openjdk16
C:\MaryZheng\DockerImages>docker run adoptopenjdk/openjdk16 Jul 07, 2021 11:36:35 AM java.util.prefs.FileSystemPreferences$1 run INFO: Created user preferences directory. | Welcome to JShell -- Version 16.0.1 | For an introduction type: /help intro jshell> C:\MaryZheng\DockerImages>
As you seen in the output, JDK16 is available in a Docker container.
5. New Features of Java 16
Oracle website outlines a list of new features in Java 16. You can also check our article about Java 16 New Features.
6. More articles
- How to update Java for Windows 10, macOS, and Android
- Java 8 Features Tutorial
- Download and Install Java Development Kit (JDK) 11
- Download and Install Java Development Kit (JDK) 13