Uncategorized
Java 5 Update for OSX
I took the new update for my java on my mac yesterday. At first i didnt notice any problems. But after a restart of CF I found it was using the new java and was not particularly happy. Some things worked fine but others were broken. As java 5 is an unsupported platform for ColdFusion MX 7 ( i think), I just wanted an easy way to downgrade my jre. After a quick search I found this article on Mac OS X Hints. This worked great for me.
Here is a way to make this happen. Open up TextEdit and paste in the code below.
#!/bin/sh
cd /System/Library/Frameworks/JavaVM.framework/Versions
CURJDK="`readlink CurrentJDK`"
echo Current JDK version: $CURJDK
if [ "$1" == "" ]; then
echo Installed versions:
ls
exit
fi
VERFOUND=`ls | grep $1 | head -n 1`
if [ "$VERFOUND" != "$1" ]; then
BASE="`basename $0`"
echo Error: Could not change JDK-- version $1 not installed!
echo Run $BASE without arguments to see a list of installed versions.
exit 127
fi
echo You must now enter your Mac OS X password to change the JDK.
sudo ln -fhsv $1 CurrentJDK
Save the file to your home directory as setJDK. Now open up Terminal(Application/Utilities/Terminal) and at the command line type:
chmod +x setJDK
Now press enter to run the command. This makes the file we created a script that can be executed. Now on the command line enter:
./setJDK
And then press enter to run the command. You will see output to the screen the list of java version you have installed. After picking the one you want ( I wanted 1.4.2 ) run this:
./setJDK 1.4.2
And press enter 1 last time to set your JDK version. Thats it. You can easily switch to another version or back to 5 if you like.
Good Luck
21 Apr 2006 Simeon 11 comments

