2009-10-22

HOWTO: Install Java 1.4 & 1.5 on Snow Leopard

Because of some projects, I need to complie some Java projects in Eclipse with older Java versions, such as 1.4.2, on my MacBook, but since Snow Leopard is such a new(!) operating system, it lacks a lot of support for softwares running with older versions of libraries.

After a long while searching in the internet, finally I found the way to install JVM 1.4 & 1.5 on Snow Leopard!

Java 1.4:
Here is how to get Java 1.4 running on snow leopard.
cd /tmp/
curl -o java.1.4.2-leopard.tar.gz http://tedwise.com/files/java.1.4.2-leopard.tar.gz
tar -xvzf java.1.4.2-leopard.tar.gz
sudo mv 1.4.2 /System/Library/Frameworks/JavaVM.framework/Versions/1.4.2
cd /System/Library/Frameworks/JavaVM.framework/Versions/
sudo ln -s 1.4.2 1.4
open "/Applications/Utilities/Java Preferences.app"
and Java 1.5:
cd /tmp/
curl -o java.1.5.0-leopard.tar.gz http://tedwise.com/files/java.1.5.0-leopard.tar.gz
tar -xvzf java.1.5.0-leopard.tar.gz
sudo mv 1.5.0 /System/Library/Frameworks/JavaVM.framework/Versions/1.5.0-leo
cd /System/Library/Frameworks/JavaVM.framework/Versions/
sudo rm 1.5.0
sudo mv 1.5.0-leo 1.5.0
sudo ln -s 1.5.0 1.5
open "/Applications/Utilities/Java Preferences.app"
It really works! ;-)

via [OneSwarm]

Update (2014-05-05): the broken links are fixed.