I have a simple requirement to be able to automate installing some other JDK on CentOS machine that already has its own JDK installed. As such here are the steps I execute on the CentOS node:
tar -zxvf jdk-8u221-linux-x64.tar.gz -C /usr
update-alternatives --install /usr/bin/java java /usr/jdk1.8.0_221/bin/java 2
alternatives --config java // and select 2 to proceed
Now under the final step I get the prompt and then have to manually enter 2. So all of that works fine. However, is there a way to skip the prompt and get that installed directly. The reason is because I am looking to automate this using a shell script.
Any help will be greatly appreciated.