简体   繁体   中英

Install java 1.5 sdk on Mac OS 10.7?

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?

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.

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.

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 .

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

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM