'Ubuntu: .bashrc has JAVA_HOME8 and JAVA_HOME11 configured but sudo update-java-alternatives --list shows only java 11
I am on Ubuntu 20.04 and I just installed Java 11. Previously I used Java 8.
Terminal command java --version prints:
openjdk 11.0.14 2022-01-18
OpenJDK Runtime Environment (build 11.0.14+9-Ubuntu-0ubuntu2.20.04)
OpenJDK 64-Bit Server VM (build 11.0.14+9-Ubuntu-0ubuntu2.20.04, mixed mode, sharing)
.bashrc file contains:
JAVA_HOME8=/usr/lib/jvm/jdk-1.8.0_212
PATH=$PATH:$JAVA_HOME8/bin
JAVA_HOME11=/usr/lib/jvm/java-11-openjdk-amd64
PATH=$PATH:$JAVA_HOME11/bin
when I run command sudo update-java-alternatives --list I get:
java-1.11.0-openjdk-amd64 1111 /usr/lib/jvm/java-1.11.0-openjdk-amd64
this is my usr/lib/jvm folder:
user@ubuntu:/usr/lib/jvm$ ls -la
total 24
drwxr-xr-x 5 root root 4096 Mar 17 13:29 .
drwxr-xr-x 117 root root 4096 Feb 23 16:14 ..
lrwxrwxrwx 1 root root 21 Jan 25 16:03 java-1.11.0-openjdk-amd64 -> java-11-openjdk-amd64
-rw-r--r-- 1 root root 2047 Jan 25 16:03 .java-1.11.0-openjdk-amd64.jinfo
drwxr-xr-x 9 root root 4096 Mar 17 13:29 java-11-openjdk-amd64
drwxr-xr-x 7 root root 4096 May 7 2019 jdk-1.8.0_212
drwxr-xr-x 2 root root 4096 Mar 17 13:29 openjdk-11
Not sure where is the inconsistency, but it is not working as intended. Can someone assist me?
Thank you.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
