In shell script I want to compare the system Java version with another Java version which I want and install if both are not same. I tried by using
java -version
head -1 file | cut -d' ' -f3
VERSION='1.8.0_1'
if [ $output -lt $VERSION ]then
sudo apt-get install default-jre