How to set or change the default Java (JDK) version on OS X?

后端 未结 28 2610
渐次进展
渐次进展 2020-11-22 15:55

How can you change the default version of Java on a mac?

28条回答
  •  余生分开走
    2020-11-22 16:07

    You can add it to your .bash_profile to have the version set by default.

    //Open bash profile
    open ~/.bash_profile
    
    export JAVA_HOME=`/usr/libexec/java_home -v 1.8`
    
    // run bash profile
    source ~/.bash_profile
    

提交回复
热议问题