1.I downloaded the java SE 8 file from oracle website. 2. I created a folder called java in opt and extracted the downloaded tar ball into that file. 3. then I took a terminal and typed this sudo update-alternatives --install /usr/bin/java java /opt/java/jdk1.8.0_231/bin/java 100 4.then I configged java and selected the correct location. 5. then I updated the java home variables in etc/environment as JAVA_HOME=/opt/java/jdk1.8.0_231 JRE_HOME=/opt/java/jdk1.8.0_231/jre. all these steps worked correctly. but at the end when type java --version it says permission denied.
chmod/chown.