1. In the instance ssh terminal, run -> uname -a
  2. It will show the OS version, for example, x86_64 is 64bit and ix86
  3. In your local machine or computer Download the specific version or tar.gz file that match with OS profile
  4. FTP into that instance, and move the *.tar.gz from your local machine to you home folder, for example /home/YOUR_USER_NAME
  5. In the instance terminal create directory by
  6. mkdir /opt/jdk
  7. Go to your home folder. For instance, cd /home/YOUR_USER_NAME
  8. You should see the tar.gz file over there. Untar the file by
  9. tar -zxf jdk-8u5-linux-x64.tar.gz -C /opt/jdk
  10. Verify that the file has been extracted into the /opt/jdk directory by
  11. ls /opt/jdk
  12. The java executable is located under /opt/jdk/jdk_SPECIFIC_VERSION/bin/java . To set it as the default JVM in your machine run:
  13. update-alternatives –install /usr/bin/java java /opt/jdk/jdk1.8.0_05/bin/java 100 and
  14. update-alternatives –install /usr/bin/javac javac /opt/jdk/jdk1.8.0_05/bin/javac 100
  15. Verify that java has been successfully configured by running:
  16. java -version
  17. and
  18. java -version