Upgrade steps when you have Java package
# Unzip/untar java to /usr/java
$ cd /usr/java ; tar xzf jdk-11.0.7.tar.gz
# Remove any existing link to latest and add link to new
$ rm latest
$ ln -s /usr/java/jdk-11.0.7 latest
# Update alternatives and set correct version
$ alternatives --config java
There are 3 programs which provide 'java'.
$ cd /usr/java ; tar xzf jdk-11.0.7.tar.gz
# Remove any existing link to latest and add link to new
$ rm latest
$ ln -s /usr/java/jdk-11.0.7 latest
# Update alternatives and set correct version
$ alternatives --config java
There are 3 programs which provide 'java'.
Selection Command
-----------------------------------------------
1 /usr/java/jdk1.8.0_202-amd64/jre/bin/java
+ 2 /usr/java/jdk-11.0.3/bin/java
* 3 /usr/java/jdk-11.0.7/bin/java
Enter to keep the current selection[+], or type selection number:
-----------------------------------------------
1 /usr/java/jdk1.8.0_202-amd64/jre/bin/java
+ 2 /usr/java/jdk-11.0.3/bin/java
* 3 /usr/java/jdk-11.0.7/bin/java
Enter to keep the current selection[+], or type selection number:
$ java -version
java version "11.0.7" 2020-04-14 LTS
Java(TM) SE Runtime Environment 18.9 (build 11.0.7+8-LTS)
Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11.0.7+8-LTS, mixed mode)