Uninstalling Java 8 on Ubuntu

Technical Articles

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

Java 8

  1. Open a terminal.

  2. Execute the following commands:

    sudo update-alternatives --remove "java" "/usr/lib/jvm/jdk1.8.0/bin/java"
    sudo update-alternatives --remove "javac" "/usr/lib/jvm/jdk1.8.0/bin/javac"    
    sudo update-alternatives --remove "javaws" "/usr/lib/jvm/jdk1.8.0/bin/javaws"
    sudo rm -r /usr/lib/jvm/jdk1.8.0
    
    Note:

    Replace "jdk1.8.0" in each of the above commands with the path to the jdk on your server.

Amazon Corretto (OpenJDK) 8:

See the following documentation from Amazon for instructions:

https://docs.aws.amazon.com/corretto/latest/corretto-8-ug/generic-linux-install.html

OpenJDK 8:

  1. Open a terminal.

  2. Execute the following command:

    sudo apt remove openjdk-8-jdk