How to set JAVA_HOME when installed OpenJDK with yum
Answer export JAVA_HOME=$(readlink $(readlink $(which java))) First which java returned the below path. /usr/bin/java Next command readlink $(which java) returned the below path. /etc/alternatives/java Last command readlink $(readlink $(which java)) returned the below path. /usr/lib/jvm/java-9-openjdk-amd64/bin/java And you can be assigned this result to environment variable.