Installing JDK 7 on Mac OS 10.6.8 [duplicate]

≯℡__Kan透↙ 提交于 2019-12-13 02:26:04

问题


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 step 6) doesn't work for me, i.e. when I open my Java Preferences.app I have no Java SE 7 so I cannot drag it!


回答1:


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



来源:https://stackoverflow.com/questions/24755900/installing-jdk-7-on-mac-os-10-6-8

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!