This is how you should Install multiple Java Versions On Linux Mint 20 using alternatives.
- Install default java version
apt install default-jdk
- Install java 8
apt install openjdk-8-jdk
- View isntalled java versions
update-java-alternatives --list
My out put is two java versions as following
java-1.11.0-openjdk-amd64 1111 /usr/lib/jvm/java-1.11.0-openjdk-amd64
java-1.8.0-openjdk-amd64 1081 /usr/lib/jvm/java-1.8.0-openjdk-amd64
- Check current version
java -version
mine is java 11
- Change java version
update-alternatives --config java
and select the required version number
and select the required version number
All set now can use multiple java versions and switch them easily.
Ref: https://techviewleo.com/install-java-openjdk-on-linux-mint/
Comments
Post a Comment