I followed this documentation to install java-1.8.0-openjdk-1.8.0.272.b10-1.portable.jdk.el.x86_64.tar.xz into RHEL 7.3.
In section 2.4. Installing OpenJDK on RHEL using an archive, at the last step, 7.Verify that javac -version works without supplying the full path:
$ javac -version
-bash: javac:command not found
I have appended the .bashrc file in the respective user account as follows:
export JAVA_HOME=~/jres/java-8
export PATH="$JAVA_HOME/bin:$PATH"
The full path for JAVA_HOME was: /home/myaccount/jres/java_8
I also edited the .bash_profile inside the /root folder with the
export JAVA_HOME=/home/myaccount/jres/java-8
This helped root account user receive a valid response when typing echo $JAVA_HOME. But it did not solve the java command not found issue.
Will appreciate any inputs to help.
JAVA_HOME, did you give the path unquoted? Does it work if you replace~(tilde) by$HOME? Did you log in again after the change to your.bashrc? The file is only sourced for new shell sessions.javacexecutable got installed? Tryfind ~/jres -name javac.