Where is Oracle's (Sun's) JDK/JRE installed on Mac OS X 10.8 Mountain Lion?

前端 未结 8 1600
余生分开走
余生分开走 2020-12-29 01:34

Where does Oracle (Sun) install their JDK/JRE on Mac OS X 10.8 Mountain Lion?

相关标签:
8条回答
  • 2020-12-29 02:13

    On my system, evaluating which java leads me to /usr/bin/java. This in turn is a symlink to:

    /System/Library/Frameworks/JavaVM.framework/Versions/Current/Commands/java
    

    In case it's relevant, java -version tells me I have 1.6.0_37 installed.

    0 讨论(0)
  • 2020-12-29 02:13

    The version 8 release from Oracle (1.8.0_40-b25) can be found at:

    /Library/Java/JavaVirtualMachines/jdk1.8.0_40.jdk/Contents/Home/bin/java
    

    FYI: Oracle is not following the practice of making /Library/Java/Current (etc) a link to the latest installed java.

    Below is my method of keeping up with versions over time: from my .zshrc file:

    108 JAVA_6_HOME=/System/Library/Frameworks/JavaVM.framework/Home
    109 JAVA_7_HOME=/Library/Java/Current
    110 JAVA_8_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_40.jdk/Contents/Home
    111 
    112 export JAVA_6_HOME
    113 export JAVA_7_HOME
    114 export JAVA_8_HOME
    115 
    116 export JAVA_HOME=$JAVA_8_HOME
    117 
    118 PATH=$PATH:$JAVA_HOME/bin
    119 
    
    0 讨论(0)
提交回复
热议问题