In the above location you'll see that multiple Java VM versions are still on the system, including Java 1.4.2. The shortest solution to using Java 1.4.2 again is not to uninstalll Java 1.5, but to change a symbolic link for CurrentJDK so that it points to 1.4.2 instead of 1.5.0.
mymac:/System/Library/Frameworks/JavaVM.framework/Versions stevenerat$ sudo rm CurrentJDK
mymac:/System/Library/Frameworks/JavaVM.framework/Versions stevenerat$ sudo ln -s 1.4.2 CurrentJDK
mymac:/System/Library/Frameworks/JavaVM.framework/Versions stevenerat$ ls -l
total 48
lrwxr-xr-x 1 root wheel 5 May 1 12:35 1.3 -> 1.3.1
drwxr-xr-x 8 root wheel 272 Apr 2 2005 1.3.1
lrwxr-xr-x 1 root wheel 5 Nov 14 2005 1.4 -> 1.4.2
drwxr-xr-x 8 root wheel 272 May 17 10:55 1.4.2
lrwxr-xr-x 1 root wheel 5 May 1 12:35 1.5 -> 1.5.0
drwxr-xr-x 8 root wheel 272 Apr 6 14:13 1.5.0
drwxr-xr-x 6 root wheel 204 May 1 12:35 A
lrwxr-xr-x 1 root wheel 1 May 1 12:35 Current -> A
lrwxr-xr-x 1 root wheel 5 May 17 11:56 CurrentJDK -> 1.4.2
Then start ColdFusion MX as normal via the command line or via ColdFusionLauncher.app
mymac:/System/Library/Frameworks/JavaVM.framework/Versions stevenerat$ cd /opt/ColdfusionMX7/bin/
mymac:/opt/ColdfusionMX7/bin stevenerat$ ./coldfusion start
Starting ColdFusion MX 7...
The ColdFusion MX 7 server is starting up and will be available shortly.
======================================================================
ColdFusion MX 7 has been started.
ColdFusion MX 7 will write logs to /opt/ColdFusionMX7/logs/cfserver.log
======================================================================
mymac:/opt/ColdfusionMX7/bin stevenerat$
Notice in ColdFusion's cfserver.log that Java 1.4.2 was used to start the server:
Starting Macromedia JRun 4.0 (Build 92909), coldfusion server
05/17 10:56:57 warning Unable to open /opt/ColdFusionMX7/runtime/lib/license.properties
05/17 10:56:58 info JRun Naming Service listening on *:2920
05/17 10:56:58 warning No sessionSecret has been specified in jrun.xml. Installing a self generated sessionSecret.
05/17 10:56:59 info No JDBC data sources have been configured for this server (see jrun-resources.xml)
05/17 10:56:59 info JRun Web Server listening on *:8500
05/17 10:56:59 info JRun Proxy Server listening on *:51011
05/17 10:56:59 info Deploying enterprise application "Macromedia ColdFusion MX" from: file:/opt/ColdFusionMX7/
05/17 10:56:59 info Deploying web application "Macromedia Coldfusion MX" from: file:/opt/ColdFusionMX7/
05/17 10:57:00 INFO License Service: Flex 1.5 CF Edition enabled
05/17 10:57:00 INFO Starting Flex 1.5 CF Edition
05/17 10:57:00 user JSPServlet: init
05/17 10:57:01 user CFMxmlServlet: init
05/17 10:57:01 user CFMxmlServlet: Macromedia Flex Build: 87315.134646
05/17 10:57:01 INFO Macromedia Flex Build: 87315.134646
05/17 10:57:02 user ColdFusionStartUpServlet: init
05/17 10:57:02 user ColdFusionStartUpServlet: ColdFusion MX: Starting application services
05/17 10:57:02 user ColdFusionStartUpServlet: ColdFusion MX: VM version = 1.4.2-54
05/17 10:57:02 Information [main] - Starting logging...
05/17 10:57:02 Information [main] - Starting crypto...
05/17 10:57:03 Information [main] - Starting license...
Now you might ask why I didn't just change the java.home setting in jvm.config.
#
# VM configuration
#
# Where to find JVM, if {java.home}/jre exists then that JVM is used
# if not then it must be the path to the JRE itself
java.home=
#
# If no java.home is specified a VM is located by looking in these places in this
# order:
#
# 1) bin directory for java.dll (windows) or lib/<ARCH>/libjava.so (unix)
# 2) ../jre
# 3) registry (windows only)
# 4) JAVA_HOME env var plus jre (ie $JAVA_HOME/jre)
#
My first attempt to make ColdFusion use JVM 1.4.2 was just that. I changed java.home to point to a variety of locations that should have done the trick but curiously none worked. I even tried setting the environment variable for JAVA_HOME in /etc/profile to point to 1.4.2's Home directory, but no luck. Not one hack made a difference and ColdFusion kept using JVM 1.5 until I changed the CurrentJDK symbolic link. Only then would ColdFusion use 1.4.2.
You should realize that by changing the CurrentJDK link to 1.4.2 will cause any program that relies upon the default JVM version to also use JVM 1.4.2. In order to make a program use JVM 1.5 you must explicitly point to it as:
/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0