Structured Programming   «Prev  Next»
Lesson 4 Installing the Java 11 JDK
Objective Install the Java 11 Software Development Kit.

Installing Java Software Development Kit

To begin writing programs in Java you will first need to download and install the Java Development Kit (JDK) version 11 from Oracle. The Java 11 SDK is the first LTS (Long Term Support) Java Development Kit since Oracle changed Java release cadence to every 6 months. The Java 2 SDK was a complete software development environment for Java, including a collection of software components that you could use in your applications. These components provided capabilities commonly needed in computer programs. In other words, these components were provided so that you did not have to reinvent the wheel when you wrote your programs. The Java 2 SDK also contained a number of tools, including a Java compiler and a Java program launcher. For this module, you will be using either
  1. OpenJDK 11 or
  2. Oracle JDK 11
to develop your own Java programs.
Oracle provides Customers with Oracle Premier Support on Oracle Java SE products as described in the Oracle Lifetime Support Policy. For product releases after Java SE 8, Oracle will designate only certain releases as Long-Term-Support (LTS) releases. Java SE 7, 8, 11 and 17 are LTS releases. Oracle intends to make future LTS releases every two years meaning the next planned LTS release is Java 21 in September 2023.
Question: What is the version of JDK 11?
Answer: The full version string for this update release is 11.0. 16+11 (where "+" means "build"). The version number is 11.0. 16.

Download and Install Java 11 (OpenJDK and Oracle JDK)

According to Oracle, JDK 11 will be supported (commercial support) until September 2026. Head to Java SE Development Kit 11 Downloads page Oracle Java 11 and choose the download file appropriate to your operating system. Oracle JDK 11 comes with installers for Linux (rpm and deb), macOS (dmg), Windows (exe) and archive files (tar.gz and zip).
For Windows, I recommend to download the file jdk-11.0.7_windows-x64_bin.exe. Note that you must have an Oracle account to be able to download JDK 11 installer. If not, creating one is free. Run the downloaded file, and you will see the JDK 11 setup program appears:
download the file jdk-11.0.7_windows-x64_bin.exe
Download the file jdk-11.0.7_windows-x64_bin.exe

Just click Next twice to proceed installation with the defaults. Note that Oracle JDK 11 does not update system environment variables, so you have to manually update PATH and/or JAVA_HOME after installation. Open Command Prompt window under administrator privilege and type the following command:
setx -m JAVA_HOME "C:\Program Files\Java\jdk-11.0.7"

If the PATH environment variable does not contain an entry to JAVA_HOME\bin, type the following command:
setx -m PATH "%JAVA_HOME%\bin;%PATH%"

Then open another command prompt window and type java –version, you will see:
download the file jdk-11.0.7_windows-x64_bin.exe
Output of java -version if installation is successful.

That means you have successfully installed and configured Oracle JDK 11 on your computer.
In the next lesson you will create and compile your first Java program.

Amazon Corretto

No-cost, multiplatform, production-ready distribution of OpenJDK.
Amazon Corretto is a no-cost, multiplatform, production-ready distribution of the Open Java Development Kit (OpenJDK). Corretto comes with long-term support that will include performance enhancements and security fixes. Amazon runs Corretto internally on thousands of production services and Corretto is certified as compatible with the Java SE standard. With Corretto, you can develop and run Java applications on popular operating systems, including Linux, Windows, and macOS.

Install the Java 2 SDK (Windows)