@Shashi, please download the desired java version from here:
oracle.com , install the binary (copy the new output folder jdk... to desired location (/usr/lib/jvm/)) , update java and javac using (sudo update-alternatives --config), set JAVA_HOME= to the new jdk folder