Steven Erat's Blog
 
 
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.


Steven,

They may not be officially supported, but it works wonderfully... in fact I've never seen CFMX respond this fast in my whole career. Admin pages load in less than one blink (I've actually had it happen... the page is finished loading before I saw it load). Your fix is OK, but it leaves the whole system running JVM 1.4.2, which doesn't provide the benefits of 1.5 (and Eclipse really seems to work better under 1.5 believe it or not)...

I've written a set of .app bundles that will launch, stop, and restart CFMX even if JVM 1.5 is the CurrentJDK.

http://www.web-relevant.com/blogs/cfobjective/inde...

Just everyone who downloads it... promise to let me know how it works for you please?

Thanks,
J


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 31  

Search This Site

 
This is an exact search only

About This Site

 
I live west of Boston and work for Adobe with ColdFusion and Flex, and specialize in Linux. I'm also interested in travel and science, and I'm studyng photography at CDIA. Curious about my banner image?

More about me

Recent Entries

 
No recent entries.

Recent Comments

 
Posted By Steven:
Cool. For better SEO results, I'll link back to you at the CDIA Blog [link] ...

Posted By CDIA:
We are excited to hear that you are enjoying the school. You might want to check out the new CDIA blog at www.cdiabu.com/blog

Posted By Ilia:
I used to think this way back in high school, and occasionally even try and convince some of my peers. I went to a 'selective' school, so most people ...

recently played

 
Episode 18 - StackOverflow
by Jeff Atwood and Joel Spolsky
on IT Conversations
IT Conversations, Jeff Atwood and Joel Spolsky

now playing, a plug-in for itunes

Categories

 
RSS Adobe (29)
RSS Bicycling (9)
RSS Blogging (37)
RSS Books (13)
RSS Breeze (12)
RSS CFMX Podcasts (10)
RSS ColdFusion (417)
RSS Computer Technology (49)
RSS Events (25)
RSS Flash (3)
RSS Flex (17)
RSS Gadgets (10)
RSS HiTech Industry (16)
RSS Java (25)
RSS Learning (54)
RSS Linux (70)
RSS Mac OS X (21)
RSS Macromedia (28)
RSS Meetup (34)
RSS New England (60)
RSS Odds & Ends (25)
RSS Outdoors (32)
RSS Personal (26)
RSS Photography (105)
RSS Photoshop (28)
RSS Podcasts (18)
RSS Rants (19)
RSS Restaurants (8)
RSS Science (34)
RSS Spain (16)
RSS Travel (42)
RSS Video (20)
RSS Webcam (3)
RSS Writing (10)

Blogs I Read

 
Scrum Sucks
Ben Forta
Ray Camden
Kinky Solutions
Gary Gilbert
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

 


Consumed By Feed-Squirrel.com
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 © 2008 Steven Erat. All rights reserved.
This is a personal weblog. The opinions expressed here represent my own and not those of my employer