Installing java 8 in centos 7 dockerfile

I just looked at this question: How to define OpenJDK 8 in CentOS based Dockerfile?.

I tried the suggested answers, but I’m not getting the expected results. Here are the contents of my DockerFile

FROM centos:7

RUN yum install -y 
       java-1.8.0-openjdk 
       java-1.8.0-openjdk-devel

ENV JAVA_HOME /etc/alternatives/jre
RUN yum install maven
RUN yum install curl 
RUN yum install -y unzip

I am building the image via: docker build -t container_image:latest -f DockerFile.build .
Then when I run docker run -it {image_id} /bin/bash and perform java --version I get bash: java: command not found. Can someone help me see what I am doing wrong here?

Source: Docker Questions