Installing Debian OpenJDK 17 on Ubuntu

Technical Articles

Solution
Application
Content Type
Technical Documentation
Utilities & Services
ft:locale
en-US

  1. Update the list of apt packages to the latest versions by executing the following command:
    sudo apt update
    
  2. Install the latest version of Debian OpenJDK 17 by executing the following command:
    sudo apt install openjdk-17-jdk
    
  3. When prompted, click Yes to continue.
  4. Execute the following command to verify the Java version:
    java --version
    
  5. If the expected latest version of OpenJDK 17.x.x is not returned, change the selected Java version by executing the following command:
    update-alternatives --config java
  6. Set the Java path by executing the following commands:
    export JAVA_HOME=/usr/lib/jvm/java-17-openjdk-amd64
    export PATH=$PATH:$JAVA_HOME/bin