vim /etc/profile.d/java.sh
#!/bin/sh
export JAVA_HOME=/tomcat/jdk
export PATH=$PATH:$JAVA_HOME/bin
find /usr/lib/jvm/java-1.x.x-openjdk
vim /etc/profile
Prepend sudo if logged in as not-privileged user, ie. sudo vim Press 'i' to get in insert mode
add:
export JAVA_HOME="path that you found"
export PATH=$JAVA_HOME/bin:$PATH
logout and login again, reboot, or use source /etc/profile to apply changes immediately in your current shell