Problem changing Java version using alternatives

后端 未结 6 1035
遥遥无期
遥遥无期 2021-02-01 07:03

I\'m not quite sure how I got into this mess, but for some reason I\'m not able to change the current version of Java using alternatives. I can run alternatives --config java a

6条回答
  •  终归单人心
    2021-02-01 07:31

    alternatives works by changing a symlink in the /usr/bin directory. However, if your path contains a valid executable earlier in the path, that will be used instead.

    In this case, judging from your previous comments, it sounds like /usr/java/jdk1.5.0_10/bin is somewhere in the path and should be removed.

    For a BASH shell, the path is usually set in ~/.bashrc or (less likely?) ~/.bash_profile

提交回复
热议问题