Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

7
  • Well, I guess you (still) have OpenJDK version 10.0.2 installed, right?  If you’re willing to uninstall that, that would be a good step. Otherwise, try PATH=$JAVA_HOME/bin:$PATH so it finds the new version. Commented Mar 21, 2019 at 21:49
  • @G-Man So it is ok to uninstall the OpenJDK version? Got some feedback in the forum it's better not to uninstall it. Commented Mar 21, 2019 at 21:51
  • @G-Man I did execute the path command provided from your side and it worked. But when I reboot my system it again point to the OpenJDK, so any suggestion in there how to configure it just once Commented Mar 21, 2019 at 21:58
  • 1
    PATH defines where the shell looks for programs (like cat, ls, java and javac). It is searched from left to right. If you say PATH=$JAVA_HOME/bin:$PATH, you put $JAVA_HOME/bin (/opt/jdk-11.0.2/bin) at the beginning of PATH, so it looks there first. If you say PATH=$PATH:$JAVA_HOME/bin, you put $JAVA_HOME/bin at the end of PATH — and the directory of OpenJDK version 10.0.2 is in the current PATH value somewhere, so it will be found rather than 11.0.2. Commented Mar 22, 2019 at 2:07
  • 1
    @G-Man Thanks for the explanation and It really helped. Appreciate the effort. In early stages of using Linux, feel relieved when getting answers from the community Commented Mar 25, 2019 at 11:31