Java installation for Linux
CentOS 6.7 has Java 1.7 version. So you don't need to install Java.
If it is necessary, you need to set JAVA_HOME or JRE_HOME on shell environment.
Please note Java 8 is recommended currently.
Setup hostname
You need to setup host name for Java.
Ref. https://www.oracle.com/technetwork/java/index.html
* Java is Oracle's trademark.