I have a Red Hat Linux machine where I am trying to use Java 8.
So I did this:
export JAVA_HOME=/my/path/to/oracle/jdk/1.8/exec export PATH=$PATH:$JAVA_HOME However, if I run java -version I get java version "1.7.0_121".
I looked at this similar question, but I don't seem to have the same problem.
If I run $JAVA_HOME/bin/java -version I get java version "1.8.0_72-b15", so JAVA_HOME does point to Java 8.
which java outputs /usr/bin/java.
So how can JAVA_HOME point to Java 8, while java -version points to Java 7?
export PATH=$JAVA_HOME:$PATHls -l /usr/bin/javashow?export PATH=$JAVA_HOME:$PATH, but nothing changes.ls -l /usr/bin/javashows/usr/java/default/bin/java.