Skip to content

How to install the JDK on Ubuntu Linux

To install the JDK (Java Development Kit) on Ubuntu Linux, follow these steps:

  1. First, update the package index:

java
sudo apt-get update
  1. Next, install the default JDK:

java
sudo apt-get install default-jdk
  1. Alternatively, you can install a specific version of the JDK by using the following command, replacing <version> with the desired version:

java
sudo apt-get install openjdk-<version>-jdk

Once the installation is complete, you can check that the JDK was properly installed by running the following command:


java
java -version

This will print the version of the JDK that is currently installed on your system.

Dual-run preview — compare with live Symfony routes.