Install Java with APT on Ubuntu

Learn how to install Java with APT on Ubuntu

Steps of installing Java with APT on Ubuntu

More Information

  1. Update apt package

    sudo apt update
  2. Install JRE

    sudo apt install default-jre
  3. Verify Java installation

    java -version
  4. Install Java JDK

    sudo apt install default-jdk
  5. Verify Java JDK installation

    javac -version

Written by

KarChunT

At

Wed Mar 26 2025