Installing Java 5 back on Snow Leopard (MacOSX 10.6.x)
Mauricio Hiroshi Nagaoka - 21-Nov-2009
I was trying to build Jetty examples in order to enable Servlet 2.5 annotation processing onJetty Maven 2 plugin and found out that these examples require Java 5 to build (JDBCclasses) and Snow Leopard simply doesn't have it.
$
ls -l /System/Library/Frameworks/JavaVM.framework/Versions/
total 48lrwxr-xr-x1 rootwheel5 Oct 23 16:51 1.3 -> 1.3.1drwxr-xr-x3 rootwheel102 Jul 20 20:35 1.3.1
lrwxr-xr-x1 rootwheel10 Oct 23 16:51 1.5 -> CurrentJDK lrwxr-xr-x1 rootwheel10 Oct 23 16:51 1.5.0 -> CurrentJDK
lrwxr-xr-x1 rootwheel5 Oct 23 16:51 1.6 -> 1.6.0drwxr-xr-x8 rootwheel272 Oct 29 10:39 1.6.0drwxr-xr-x9 rootwheel306 Oct 29 10:39 Alrwxr-xr-x1 rootwheel1 Oct 23 16:51 Current -> Alrwxr-xr-x1 rootwheel3 Nov 21 12:17 CurrentJDK -> 1.6
This "how-to" is based onchxo internets', but usesunpkginstead of Pacifistto extract the
pkg file and a newer Java update.First, a disclaimer: do it at you own risk. Don't blame me if you mess up your computer. :p- DownloadJava for Mac OS X 10.5 Update 5- Mount the dmg file (JavaForMacOSX10.5Update5.dmg)- Unpackage the pkg file (JavaForMacOSX10.5Update5.pkg) on your Desktop- Remove the previous 1.5 and 1.5.0 links from /System/Library/Frameworks/JavaVM.framework/Versions
$
cd /System/Library/Frameworks/JavaVM.framework/Versions
$
ls -l 1.5 1.5.0
lrwxr-xr-x1 rootwheel10 Nov 21 13:57 1.5 -> CurrentJDKlrwxr-xr-x1 rootwheel10 Nov 21 13:57 1.5.0 -> CurrentJDK$
sudo rm 1.5 1.5.0
- Move the unpackaged 1.5.0 folder from your Desktop to /System/Library/Frameworks/JavaVM.framework/Versions
$
sudo mv ~/Desktop/JavaForMacOSX10.5Update5/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0 /System/Library/Frameworks/JavaVM.framework/ Versions/1.5.0
- Fix the ownership
$
sudo chown -R root:wheel /System/Library/Frameworks/JavaVM.framework/ Versions/1.5.0
Add a Comment