I have CentOS 6.7. I installed OpenJDK 1.8 with the following command.
yum install java-1.8.0-openjdk-devel
After installing I executed the following two commands.
export JAVA_HOME=/usr/jdk/jdk1.8.0_121
export PATH=$JAVA_HOME/bin:$PATH
But when I type java -version I still see the following output. I do not see OpenJDK.
java version "1.8.0_121"
Java(TM) SE Runtime Environment (build 1.8.0_121-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.121-b13, mixed mode)
EDIT
I have posted a similar thread, regarding not finding 'javac' in the thread -bash: javac: command not found” error after installing OpenJDK 1.7 In that thread I was not able to execute javac which was resolved and it was about OpenJDK 1.7 (not 1.8). But this thread is all about java -version not showing OpenJDK for OpenJDK 1.8.