Steven Erat's Blog Steven Erat Photography
 
 
Viewing By Entry
 
 

TalkingTree  Making ColdFusion MX on Mac OS X use JVM 1.4.2 instead of JVM 1.5.0

 

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.

mymac:~ stevenerat$ cd /System/Library/Frameworks/JavaVM.framework/Versions/

mymac:/System/Library/Frameworks/JavaVM.framework/Versions stevenerat$ ls -l
total 40
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 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.

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

 


Comments

I ran into the same issue. In my searching i found a small script to make switching your java version really easy. I blogged about it on my site at http://www.simb.net/blog/index.cfm/2006/4/21/Java-...


Or Adobe could finally get around to supporting CFMX on JDK 1.5. ;) Seriously though, JRun with Updater 6 supports JDK 1.5, and that was released on August 31, 2005. I don't know why there hasn't been any update to CFMX to allow the same compatibility.


FWIW, I've finally got CFMX working fine with JDK 1.5_04 running on BEA Weblogic 9.1. There were two modifications I had to do - one, do *not* use the jvm workaround listed in the technote regarding setting the headless environment (java.awt.headless=true is all you need in the startup script). Two, name JDBC JNDI datasource names identical to your CFMX datasource names, otherwise they have problems. Voila!


I believe the problems caused by JVM 1.5 are l limited to Verity, Web Services, and some less used aspects of Date functions.

For Verity see this (no solution, just don't use 1.5):
http://www.talkingtree.com/blog/index.cfm/2005/11/...

The Verity problem is due to the version of Verity included in CFMX 7. The Web Services problem has do with the compiler used to generate the stubs.


Nah, there are other issues too that people have noted. One that comes to mind is that cfdocument breaks. Also, I *think* Paul Hastings mentioned that some globalization features break.

I certainly don't see it as a small task to get CFMX up to 1.5, but it has been out now for almost two years and it seems like it's time to really dig in and get it done.


I made the changes as directed, but CF still won't start. I've got a MacBook Pro 17" and I'm getting the following error: Java for ppc cannot run in this configuration

Is 1.4.2 only for ppc?


Just changed back to 1.5.0 and still get the same error message. Even tried to start ColdFusion from the command line but the error message about ppc is still there. I'm downloading the J2SE 5.0 Release 4 for Intel right now. Maybe I downloaded the wrong version by mistake.


I was getting a "Jrun Servlet Error" 500 when I tried to access the CF Admin page, this was fixed by changing the JVM.

Thanks


Hi guys
I have being trying desperatley for the last week to get jrun 4 to run on macbook so ican get mx 7 to run. I can get to the launcher but when i try to launch the admin server it errors. it says to look for a console log which is not there > the only info i have is that in terminal it says error cannot find jvm" I have java 1.4.2 installed > if you have any ideas how i could fix this please let me know Thanks


Maurice, ColdFusion and JRun are not supported for use on MBP. You should check the blogs of Ray Camden, Mark Drew, and Simeon Bateman for their advice with this configuration if you want to proceed.


Hey Jared,

Thanks for the tip. I saw your blog post on this yesterday. I'm sure many will benefit from your time investment towards solving this problem.


A really big thank you for this tip. You are a lifesaver!


I am running coldfusion MX 6.1 on Java 1.5.0_03 in a windows environment. If anyone of you guys know a solution for tthe same problem please help. I cannot get my webservices to run!!


 

 

Calendar

 
Sun Mon Tue Wed Thu Fri Sat
      1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30    

Search This Site

 
This is an exact search only

About This Site

 
Adobe Alumni & Community Professional. Expert in ColdFusion, Flex, LCDS, Photoshop, Lightroom. Linux RHCE. Follow Me!. For my photography check out Boston Portrait Photographer.
More about me

Recent Entries

 
ColdFusion 9.01 Server Monito..

Recent Comments

 
Posted By Swagat:
Ben Forta, best-selling ColdFusion author is coming to India this August at India's largest Adobe Flash Platform Conference. Ben Forta will conduct a ...

Posted By Steve:
The updated presentation I gave at CF.Objective() 2010 is available here: [link] At the end of the preso I gave a brief, pre-recorded demo of wri ...

Posted By Brad Munz:
I've come across a OOM problem in HotSpot which looks alot like this: java.lang.OutOfMemoryError: requested 4096000 bytes for GrET in /BUILD_AREA/jdk6 ...

recently played

 

no song is playing

now playing, a plug-in for itunes

Categories

 
RSS Adobe (34)
RSS Bicycling (9)
RSS Blogging (39)
RSS Books (13)
RSS Breeze (13)
RSS CFMX Podcasts (10)
RSS ColdFusion (429)
RSS Computer Technology (51)
RSS Events (26)
RSS Flex (20)
RSS Gadgets (10)
RSS HiTech Industry (16)
RSS Java (25)
RSS Learning (57)
RSS Linux (70)
RSS Mac OS X (22)
RSS Macromedia (27)
RSS Meetup (35)
RSS New England (62)
RSS Odds & Ends (25)
RSS Outdoors (32)
RSS Personal (29)
RSS Photos (111)
RSS Photoshop (29)
RSS Podcasts (18)
RSS Rants (19)
RSS Restaurants (8)
RSS Science (34)
RSS Spain (16)
RSS Travel (42)
RSS Twitter (10)
RSS Video (20)
RSS Webcam (3)
RSS Writing (10)

Blogs I Read

 
Terrence Ryan
Ben Forta
Ray Camden
Kinky Solutions
Dan Vega
Gary Gilbert
Simeon Bateman
Red Hat Blogs
O'Reilly Digital Media
O'Reilly Radar
John Nack
The Strobist
Scott Kelby
Matt Kloskowski
Joe McNally
Digital Photography School
Engadget
Science Blog

RSS

 


Add to Google
Add to My Yahoo!

Aggregated By

 


Aggregated by ColdFusionBlogger.org

Credits and Stuff

 
BlogCFC - Free ColdFusion Powered Blog Software
CJM Group - ColdFusion Website Hosting


 
 
blog | photos | flickr | referers | webcam | stats | about | contact
 
Copyright © 2010 Steven Erat. All rights reserved.
This is a personal weblog. The opinions expressed here represent my own and not those of my employer