Via Simon. After installing JDK1.5 available via Developer Connection:
cd /System/Library/Frameworks/JavaVM.framework/Versions/
sudo rm CurrentJDK
sudo ln -s 1.5 CurrentJDK
And then ...
java -version
java version "1.5.0_05"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_05-61)
Java HotSpot(TM) Client VM (build 1.5.0_05-40, mixed mode)
Bingo!
Posted by savs at October 11, 2005 3:34 PMI just modified my path in .bashrc
export PATH=/System/Library/Frameworks/JavaVM.framework/Versions/1.5/Commands/:$PATH
And then modify environment.plist*
The symlink approach is certainly cleaner :)
* http://developer.apple.com/qa/qa2001/qa1067.html
Posted by: Nikolas Coukouma at October 11, 2005 6:39 PMBad, bad, bad!!!!
Don't do this, it will cause you all kinds of troubles when you try to install future upgrades. Apple has time and time again told people not to do this on the java-dev lists. If you want to change the default JDK, set your path appropriately (as you have to do with every other OS) and use /Applications/Utilities/Java/J2SE 5.0/Java Preferences.app to set the preferred order for JRE search in applets and applications.
Don't go round modifying files in /System, it's always a bad idea.
Posted by: Adrian Sutton at October 11, 2005 9:28 PMWow, this is just horrible. Why can't Apple do something sensible with /usr/bin/java? For example, they could take the Debian approach and symlink it to /etc/alternatives/java.
Point taken about files in /System, but really Apple should make a tool available that does the symlink trick officially - their current tool is only for applets and applications, and doesn't help if you're console-based.
Posted by: Andrew Savory at October 11, 2005 10:05 PM