In this blog post I am going to show you how to downgrade java and javac on ubuntu/kali linux. Some applications will require older version of java; For instance, I had to downgrade from openjdk 10 to openjdk 8 because Jenkins doesn’t support openjdk 10.
The availability of java versions depends on your repository source list (/etc/apt/source.list). Use the command below to search for available jdks and then select one from them,
sudo apt-cache search jdk
In my case I will choose jdk8, so let me install jdk8 using the commands below.
sudo apt-get update sudo apt-get install openjdk-8-jdk
This will install java jdk8, but we need to make a selection for default version of java among the existing versions i.e; between jdk10 & jdk8. To change this preference use the command below and make a selection.
sudo update-alternatives --config javac
This will update for javac, the java compiler. Now, let’s do the same for java
sudo update-alternatives --config java
Now, let’s check the java & javac versions.
Please make sure to checkout other blog posts on goacademy