AWS – Install Java

Login to the console.

Find the package.

[ec2-user@ip-172-31-16-82 ~]$ sudo yum search openjdk

Install.

[ec2-user@ip-172-31-16-82 ~]$ sudo yum install java-1.8.0-openjdk-devel.x86_64

Check it out.

[ec2-user@ip-172-31-16-82 ~]$ java -version
openjdk version “1.8.0_151”
OpenJDK Runtime Environment (build 1.8.0_151-b12)
OpenJDK 64-Bit Server VM (build 25.151-b12, mixed mode)

Alternatives if java isn’t installed, etc

References

http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/find-software.html

https://tecadmin.net/install-java-8-on-centos-rhel-and-fedora/#