Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
717 views
in Technique[技术] by (71.8m points)

macos - How to get JDK 1.5 on Mac OS X

I've got to write some code for a legacy application that is still running JDK 1.5. Unfortunately, it looks like OS X doesn't actually have a 1.5 JDK installed; it just links to 1.6:

/System/Library/Frameworks/JavaVM.framework/Versions $ ls -l
lrwxr-xr-x  1 root  wheel    5 Apr 26 11:53 1.3 -> 1.3.1
drwxr-xr-x  3 root  wheel  102 Feb 11 15:33 1.3.1
lrwxr-xr-x  1 root  wheel   10 Apr 26 11:53 1.4 -> CurrentJDK
lrwxr-xr-x  1 root  wheel   10 Apr 26 11:53 1.4.2 -> CurrentJDK
lrwxr-xr-x  1 root  wheel   10 Apr 26 11:53 1.5 -> CurrentJDK
lrwxr-xr-x  1 root  wheel   10 Apr 26 11:53 1.5.0 -> CurrentJDK
lrwxr-xr-x  1 root  wheel    5 Apr 26 11:53 1.6 -> 1.6.0
drwxr-xr-x  7 root  wheel  238 Apr 26 11:53 1.6.0
drwxr-xr-x  8 root  wheel  272 Apr 26 11:53 A
lrwxr-xr-x  1 root  wheel    1 Apr 26 11:53 Current -> A
lrwxr-xr-x  1 root  wheel    3 Apr 26 11:53 CurrentJDK -> 1.6

It sounds like from http://developer.apple.com/java/faq/ that Java is part of the OS update...I'm on Mac OS X v10.6.3 (Snow Leopard). Is there a way to get an actual 1.5 JDK installed on this OS version?

Or do I need to try and find an old version of OS X before I can do this work?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Have a look at http://wiki.oneswarm.org/index.php/OS_X_10.6_Snow_Leopard on how to get and install 1.4 and 1.5 JDKs on Snow Leopard. Also bear in mind that whenever you run Software Update and a JDK update is installed, you will need to "fix" the symlinks to the 1.4 and 1.5 JDKs.

UPDATE: as a side note, for those developing with several JDKs on OS X, have a look at this handy little utility to switch JDK from the command line: setjdk.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...