This question already has an answer here:<ul><li> <a href="/questions/13536667/how-to-install-java-jdk-7-on-snow-leopard" dir="ltr" rel="nofollow">How to install java jdk 7 on Snow Leopard</a> <span class="question-originals-answer-count"> 9 answers </span> </li> </ul>
I have a Mac with OS Snow Leopard (10.6.8). I want to develop with JDK 7 but Oracle's website says JDK need OS 10.7.3 and later. So I followed some questions and answers on a similar topic here on Stackoverflow and found the following answer (by @larsac), using Pacifist to install JDK 7:
"The answer from @reukiodo is definitely the way to go, so thanks a bunch!. However, it might need some further explanation for newbs like myself.
1) Download the two DMG's that @reukiodo posted links to.
2) Install Pacifist.
3) Open the java-DMG with pacifist.
4) In the 'Package Contents'-tab (default tab), select the 'Contents of JDK 7 Update XX.pkg' (XX being e.g. 51).
5) Click the 'Install' button and follow the on-screen instructions.
6) Open Java Preferences.app in yout Utilities folder and drag Java SE 7 to the top of the list of Java versions in the 'General'-tab (default tab)."
I followed all these steps: as far as step 5) everything works fine, but then <strong>step 6) doesn't work</strong> for me, i.e. when I open my <strong>Java Preferences.app</strong> I have no Java SE 7 so I cannot drag it!Answer1:
Mac has a useful tool for change between several java versions that can help you. This is /usr/libexec/java_home.
Then you can try set JAVA_HOME on .profile file at your home
export JAVA_HOME=$(/usr/libexec/java_home -v 1.7)
just be sure that you have 1.7 version entry at /Library/Java/JavaVirtualMachines folder