/  3
 
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 -> CurrentJDlrwxr-xr-x1 rootwheel10 Oct 23 16:51 1.5.0 -> CurrentJD
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
 
- Create the 1.5 link to 1.5.0
$
cd /System/Library/Frameworks/JavaVM.framework/Versions
$
sudo ln -s 1.5.0 1.5
- You will end up having something like this:
$
ls -l /System/Library/Frameworks/JavaVM.framework/Versions
total 40lrwxr-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 rootwheel5 Nov 21 14:08 1.5 -> 1.5.0drwxr-xr-x8 rootwheel272 Nov 21 13:53 1.5.0
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 13:56 CurrentJDK -> 1.6
- When you open the Java Preferences utiltity (/Applications/Utilities/Java Preferences.app),you should see the Java 1.5 options.

Share & Embed

More from this user

Add a Comment

Characters: ...