I'm having trouble to configure oracle JDK 11 to the system. I have extracted the JDK and ran the following in the terminal
~$ export JAVA_HOME=/opt/jdk-11.0.2
~$ export PATH=$PATH:$JAVA_HOME/bin
I also did execute the command
~$ sudo update-alternatives --install "/usr/bin/java" "java" "/opt/jdk-11.0.2/bin/java" 1
and I removed the IceTea Browser plug-in (recommend by1) When I run the java -version command I get the following
openjdk version "10.0.2" 2018-07-17
OpenJDK Runtime Environment (build 10.0.2+13-Ubuntu-1ubuntu0.18.04.4)
OpenJDK 64-Bit Server VM (build 10.0.2+13-Ubuntu-1ubuntu0.18.04.4, mixed mode)
while I run the javac -version I get the following result javac 11.0.2
[Note]: I performed the java configuration related actions via referring to multiple sources (YouTube videos, Linux Mint forum & other random places)
PATH=$JAVA_HOME/bin:$PATHso it finds the new version.PATHdefines where the shell looks for programs (likecat,ls,javaandjavac). It is searched from left to right. If you sayPATH=$JAVA_HOME/bin:$PATH, you put$JAVA_HOME/bin(/opt/jdk-11.0.2/bin) at the beginning ofPATH, so it looks there first. If you sayPATH=$PATH:$JAVA_HOME/bin, you put$JAVA_HOME/binat the end ofPATH— and the directory of OpenJDK version 10.0.2 is in the currentPATHvalue somewhere, so it will be found rather than 11.0.2.