java 1.5 in Snow Leopard
Recently I've installed Snow Leopard as my main system and found out that there is no JDK 1.5 in the system - only 1.6.
Sadly, one of my project needed to be build with JDK 1.5 because I deploy it in jetty container which is running in 1.5 jvm. Happily, I was able to transfer JDK 1.5 from my other notebook with Leopard, so now I have both 1.5 and 1.6 versions of java in Snow Leopard.
Below goes instructions how to do it:
user@leopard% cd /System/Library/Frameworks/JavaVM.framework/Versions
user@leopard% zip -9ry ~/java.zip 1.5.0...
user@snow-leopard% sudo -s
root@snow-leopard# cd /System/Library/Frameworks/JavaVM.framework/Versions
root@snow-leopard# scp user@leopard:~/java.zip .
root@snow-leopard# rm -f 1.5*
root@snow-leopard# unzip java.zip
root@snow-leopard# ln -s 1.5.0 1.5
Now, system utility called "Java Preferences" can be used to manage java version. However, it failed to set correct JDK for my maven from macports, so I had to
root@snow-leopard# rm -f CurrentJDK && ln -s 1.5.0 CurrentJDK
after doing so everything went smoothly