How do I uninstall Java 11 to be able to install Java 8 for Android Studio?

No need to uninstall your other java version(s) that's already installed on your machine. Whenever required, you can conveniently use the utility 'update-alternatives' to choose the Java runtime that you wish to activate. It will automagically update the required symbolic links.

You just need to run the below command, and select the version of your choice. That's all!

sudo update-alternatives --config java

/usr/bin/java is a symbolic link to /etc/alternatives/java which is in turn is a symbolic link to /usr/lib/jvm/java-11-oracle/bin/java. From this, it seems that you've downloaded and configured Oracle's Java 11. Moreover JDK doesn't appear as an standalone app in Ubuntu Software.

To get rid of that Java and install Java 8 (OpenJDK):

  • Remove the Oracle's Java folder:

    sudo rm -r /usr/lib/jvm/java-11-oracle
    
  • Install OpenJDK 8 from APT:

    sudo apt install openjdk-8-jdk openjdk-8-jre
    
  • Confirm Java version using:

    java -version