To install Oracle Java on Ubuntu 20.04, you can follow these steps:
Download the Oracle Java 11 JDK for Linux from the Oracle website.
Extract the downloaded ZIP file to the desired installation location. For example:
mkdir -p /opt/java unzip jdk-11.0.10_linux-x64_bin.zip -d /opt/java
JAVA_HOME
environment variable to the path of the Java 11 installation. For example:echo 'export JAVA_HOME="/opt/java/jdk-11.0.10"' >> ~/.bashrc
bin
directory of the Java 11 installation to the PATH
environment variable. For example:echo 'export PATH="$PATH:$JAVA_HOME/bin"' >> ~/.bashrc
source ~/.bashrc
java -version
For more information on installing Java on Ubuntu 20.04, you can refer to the Oracle documentation or the OpenJDK documentation.