

Java HotSpot(TM) 64-Bit Server VM (build 16.0.1+9-24, mixed mode, sharing) Java(TM) SE Runtime Environment (build 16.0.1+9-24) We can check the installed Java before and after executing these commands as shown below: We can configure the Java commands to use the newly installed JDK by default. The nano editor should be similar to Fig 2. Now press Ctrl + O and hit Enter to write our change. Scroll down by pressing Page Down button and add at the end of this file: In this step, we will configure the environment variable to use the JDK installed by us via the command line. The above steps will install JDK to the path /usr/java/oracle/jdk-18.0.1.1.

# Copy the download to Oracle JDKs directory

Now copy the downloaded file to this location and extract it as shown below: We can install multiple versions of Java in this directory. Open the terminal and make directory /usr/java/oracle to keep all the oracle java installations at the same place. It will start downloading JDK 18 for Ubuntu. It will show the JDK download page as shown in Fig 1.Ĭlick the download link as highlighted in Fig 1. Open the browser and search for Download JDK 18 or click the link to download from the Oracle website. You can follow How To Install Java 17 On Ubuntu 20.04 LTS. The premier support will be available till September 2026 and extended support will be available till September 2029. Notes: The Java 17 is an LTS version which means there will be long-time support from Oracle for the same. You may also follow the How To Install OpenJDK 18 On Windows to install the latest OpenJDK on Windows and How To Install Java 18 On Windows to install Oracle JDK. You can also follow the steps to install How To Install VSCode For Java On Ubuntu, How To Install IntelliJ IDEA for Java on Ubuntu, and How To Install Eclipse For Java Development On Ubuntu published by Tutorials24x7.

The steps should be the same for other versions of Ubuntu, and Linux. It provides all the steps for Ubuntu 20.04 LTS (Focal Fossa). This tutorial provides all the steps required to install Java 18 on the popular Linux distribution i.e.
