Install/upgrage Java 8 using Yum on EC2 instance (Amazon Linux AMI)
Step-1: Install Java
Runtime – java 1.8
sudo yum install java-1.8.0
if you need a java compiler and other developer tools:
sudo yum install java-1.8.0-openjdk-devel
Step-2: If you have multiple versions and one of those default , use the alternatives command as follows and enter the selection number as guided in the terminal.
sudo /usr/sbin/alternatives –config java
sudo /usr/sbin/alternatives –config javac
Step-3: (Optional)
If you prefer you can remove Java 1.7
sudo yum remove java-1.8.0-openjdk
Note : Remove it after you installed Java 1.8 otherwise the aws-apitools will also be removed as they depend on Java to be installed