JAVA_HOME and PATH are set but java -version still shows the old one

前端 未结 10 1418
温柔的废话
温柔的废话 2020-11-29 01:12

I am using Linux Mint Cinnamon 14. I have set the $JAVA_HOME and $PATH environment variables in ~/.profile as follows:



        
10条回答
  •  情歌与酒
    2020-11-29 02:02

    Try this:

    • export JAVA_HOME=put_here_your_java_home_path
    • type export PATH=$JAVA_HOME/bin:$PATH (ensure that $JAVA_HOME is the first element in PATH)
    • try java -version

    Reason: there could be other PATH elements point to alternative java home. If you put first your preferred JAVA_HOME, the system will use this one.

提交回复
热议问题