1

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!

halfer
  • 19,824
  • 17
  • 99
  • 186
user3729787
  • 121
  • 2
  • 11

1 Answers1

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

BenMorel
  • 34,448
  • 50
  • 182
  • 322
Rafael
  • 2,521
  • 2
  • 33
  • 59
  • @Benjamin How can you have 1.7 at /Library/Java/JavaVirtualMachines? This folder is empty. – Karlo Nov 09 '16 at 20:09