3

Mac OS 10.7 (Lion) comes with JDK 1.6 and java 6. Is it feasible to install 1.5 as well so the two can co-exist?

Would you just install the JDK in /System/Library/Frameworks/JavaVM.framework/Versions and then update the symlink to 1.5 so it points to the correct version instead of the default 1.6 (latest)?

Then update the JAVA_HOME environment variable accordingly?

Dan Holman
  • 825
  • 1
  • 10
  • 20

5 Answers5

3

I've been following the links and script on this website to install it on Mac OS 10.7.5 64-bit, and it's been working fine except when I install Apple Java Security updates, which seem to make my JDK terminate on startup without any notifications.

Reinstalling it has been fixing the issue.

I also use a simple Bash script to change the JAVA_HOME to the JDK 1.5 location, when I need to switch from 1.6 to 1.5.

the Tin Man
  • 158,662
  • 42
  • 215
  • 303
cleberz
  • 601
  • 7
  • 11
2

There is no need to have co-existing JDKs. Just an rt.jar (or whatever contains the J2SE classes in your OS) of the target version, the cross-compilation options and the latest JDK can compile code compatible for any earlier release that is required.

Andrew Thompson
  • 168,117
  • 40
  • 217
  • 433
  • this is true if the goal is to build 1.5 compatible binaries. But each release of the JVM sees changes in GC, JIT, etc. So from a runtime perspective, there is no true substitute. – Dilum Ranatunga Aug 11 '11 at 21:21
1

From what I remember, there's no 64 bit Java 1.5 for OSX. So you are going to run into problems even if you can find the installer. For example, see the unanswered How to run 32-bit Java on Mac OSX 10.7 Lion .

Community
  • 1
  • 1
Dilum Ranatunga
  • 13,254
  • 3
  • 41
  • 52
1

It's a little more complicated than in Snow Leopard, but it can be done in OS X Lion:

http://www.s-seven.net/java_15_lion

B Morin
  • 11
  • 2
0

From here:
https://discussions.apple.com/message/15760121#15760121

Better explaination:

1) Download and install Pacifist from: http://www.charlessoft.com/Pacifist.dmg
2) Download and Mount JavaForMacOSX10.6Update5 from http://support.apple.com/kb/DL1360
3) Download and Mount JavaForMacOSX10.7 from http://support.apple.com/kb/DL1421
4) Launch Pacifist and select Open Package
5) Select the mounted JavaForMacOSX10.6Update5.pkg
6) Hit install, when it prompts always select "Replace"
7) After it is complete, select Open Package and select the JavaForMacOSX10.7.pkg
8) When it prompts select "Replace"
9) You can copy Safari 5.0.5 from SL or if you do not have access to a SL machine
10) Download and mount Safari 5.0.5 from http://appldnld.apple.com.edgesuite.net/content.info.apple.com/Safari5/041-0564. 20110413.Fi9pb/Safari5.0.5SnowLeopard.dmg
11) In Pacifist select Open Package and select the Safari 5.0.5 pkg file
12) This time select Extract and place it onto your desktop
13) Go to the Safari5.0.5SnowLeopard folder on your desktop, inside of that you will see an Applications folder, open that and you will see Safari, you can rename this Safari, I named mine Safari 5.0.5 and copy it to your main Applications folder or whereever you want.
14) Launch this Safari and go to About and make sure it says 5.0.5
15) Try your Secure App Manager.

Zanson
  • 3,991
  • 25
  • 31