If you're running ColdFusion MX and you've installed the Java 5 update for Mac OS X during one of the regular prompts to install software updates then you will encounter problems because ColdFusion MX 6 or 7 is not supported to run on Java 5, but only Java 1.4.2 at the highest.

There is an easy solution to this problem. You'll find that previous versions of the Java VM are still installed on your Mac, but they are simply not the default.

view plain print about
1mymac:~ stevenerat$ cd /System/Library/Frameworks/JavaVM.framework/Versions/<br/><br/>mymac:/System/Library/Frameworks/JavaVM.framework/Versions stevenerat$ ls -l
2total 40
3lrwxr-xr-x 1 root wheel 5 May 1 12:35 1.3 ->
1.3.1
4drwxr-xr-x 8 root wheel 272 Apr 2 2005 1.3.1
5lrwxr-xr-x 1 root wheel 5 Nov 14 2005 1.4 -> 1.4.2
6drwxr-xr-x 8 root wheel 272 May 17 10:55 1.4.2
7lrwxr-xr-x 1 root wheel 5 May 1 12:35 1.5 -> 1.5.0
8drwxr-xr-x 8 root wheel 272 Apr 6 14:13 1.5.0
9drwxr-xr-x 6 root wheel 204 May 1 12:35 A
10lrwxr-xr-x 1 root wheel 1 May 1 12:35 Current -> A
11lrwxr-xr-x 1 root wheel 5 May 1 12:35 CurrentJDK -> 1.5.0


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.

view plain print about
1mymac:/System/Library/Frameworks/JavaVM.framework/Versions stevenerat$ sudo rm CurrentJDK<br/><br/>mymac:/System/Library/Frameworks/JavaVM.framework/Versions stevenerat$ sudo ln -s 1.4.2 CurrentJDK<br/><br/>mymac:/System/Library/Frameworks/JavaVM.framework/Versions stevenerat$ ls -l
2total 48
3lrwxr-xr-x 1 root wheel 5 May 1 12:35 1.3 ->
1.3.1
4drwxr-xr-x 8 root wheel 272 Apr 2 2005 1.3.1
5lrwxr-xr-x 1 root wheel 5 Nov 14 2005 1.4 -> 1.4.2
6drwxr-xr-x 8 root wheel 272 May 17 10:55 1.4.2
7lrwxr-xr-x 1 root wheel 5 May 1 12:35 1.5 -> 1.5.0
8drwxr-xr-x 8 root wheel 272 Apr 6 14:13 1.5.0
9drwxr-xr-x 6 root wheel 204 May 1 12:35 A
10lrwxr-xr-x 1 root wheel 1 May 1 12:35 Current -> A
11lrwxr-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

view plain print about
1mymac:/System/Library/Frameworks/JavaVM.framework/Versions stevenerat$ cd /opt/ColdfusionMX7/bin/<br/><br/>mymac:/opt/ColdfusionMX7/bin stevenerat$ ./coldfusion start
2Starting ColdFusion MX 7...
3The ColdFusion MX 7 server is starting up and will be available shortly.
4======================================================================
5ColdFusion MX 7 has been started.
6ColdFusion MX 7 will write logs to /opt/ColdFusionMX7/logs/cfserver.log
7======================================================================
8mymac:/opt/ColdfusionMX7/bin stevenerat$


Notice in ColdFusion's cfserver.log that Java 1.4.2 was used to start the server:

view plain print about
1Starting Macromedia JRun 4.0 (Build 92909), coldfusion server
205/17 10:56:57 warning Unable to open /opt/ColdFusionMX7/runtime/lib/license.properties
305/17 10:56:58 info JRun Naming Service listening on *:2920
405/17 10:56:58 warning No sessionSecret has been specified in jrun.xml. Installing a self generated sessionSecret.
505/17 10:56:59 info No JDBC data sources have been configured for this server (see jrun-resources.xml)
605/17 10:56:59 info JRun Web Server listening on *:8500
705/17 10:56:59 info JRun Proxy Server listening on *:51011
805/17 10:56:59 info Deploying enterprise application "Macromedia ColdFusion MX" from: file:/opt/ColdFusionMX7/
905/17 10:56:59 info Deploying web application "Macromedia Coldfusion MX" from: file:/opt/ColdFusionMX7/
1005/17 10:57:00 INFO License Service: Flex 1.5 CF Edition enabled
1105/17 10:57:00 INFO Starting Flex 1.5 CF Edition
1205/17 10:57:00 user JSPServlet: init
1305/17 10:57:01 user CFMxmlServlet: init
1405/17 10:57:01 user CFMxmlServlet: Macromedia Flex Build: 87315.134646
1505/17 10:57:01 INFO Macromedia Flex Build: 87315.134646
1605/17 10:57:02 user ColdFusionStartUpServlet: init
1705/17 10:57:02 user ColdFusionStartUpServlet: ColdFusion MX: Starting application services
1805/17 10:57:02 user ColdFusionStartUpServlet: ColdFusion MX: VM version = 1.4.2-54
1905/17 10:57:02 Information [main] - Starting logging...
2005/17 10:57:02 Information [main] - Starting crypto...
2105/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.

view plain print about
1#
2# VM configuration
3#
4# Where to find JVM, if {java.home}/jre exists then that JVM is used
5# if not then it must be the path to the JRE itself
6java.home=
7#
8# If no java.home is specified a VM is located by looking in these places in this
9# order:
10#
11# 1) bin directory for java.dll (windows) or lib/<ARCH>/libjava.so (unix)
12# 2) ../jre
13# 3) registry (windows only)
14# 4) JAVA_HOME env var plus jre (ie $JAVA_HOME/jre)
15#


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:

view plain print about
1/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0