Jan 31, 2010

Easiest way to upgrade your ColdFusion JDK

I just got a new laptop and have been setting up my local dev environment. After installing IIS and ColdFusion ( 8 and 9 ) I wanted to bump the JDK past the class loader issues with pre 1.6.0_10. I figured I'd go with the most recent ( 1.6.0_18 )

This is a simple process and I'll outline it here. This is the same on Win XP, 2003, Vista, Windows 2008 and Windows 7.

Download the JDK: http://java.sun.com/javase/downloads/index.jsp

Choose the appropriate edition ( I'm running 64bit Windows and CF8 ) so 64 bit edition for me. Make sure you get the JDK not the JRE.

Install the JDK and take note of the install directory. I left it all as default and the install folder is: C:\Program Files\Java\jdk1.6.0_18

Browse to you CFADMIN and select Java and Java Settings:



Replace the Java Virtual Machine path with C:\Program Files\Java\jdk1.6.0_18\jre

Save this and restart your CouldFusion services.

Log back into the CFADMIN click Settings and Summary and confirm the java version is now 1.6.0_18.

 
And that's it.

Jan 8, 2010

A small gotcha with cfexecute

This might get alot of people when running cfexecute consider this simple example of passing the result of the command dir back to ColdFusion:



It won't work. Why not? Because timeout is missing. It won't error on the cfexecute call but it will never get a result so dirResult wont exist.



While my example is Windows specific the timeout attribute is required when calling *nix command aswell.

Jan 5, 2010

Automake - aclocal: command not found

I was setting up a new server and compiling some apache conectors when I came across this error:

me@server.com: make
cd . && aclocal
/bin/sh: aclocal: command not found
make: *** [aclocal.m4] Error 127

Where does this come from and how do you fix it?

It's part of Automake . To fix it on Debian/Ubuntu:

apt-get install automake

and CentOs

yum install automake

Or you can download and set it up here.

Jan 1, 2010

ColdFusion 9 and the local scope continued

This post is to try clear up any confusion on yesterdays post. The issue was a little confusing and that is probably due to the fact the the example came from some code that was not normal. Ie the code did work as expected it's just not something someone would normally do so it lead to some confusion.

Thanks to Glen who constantly came back with what was really going on I see what I originally thought might have been an error with CF9 was actually functioning as expected.

Here is the demo running: http://cf9.kukiel.net/demos/local/demo4.cfm

All the scopes function the same way as intended.

Anything inside a method that is var scoped will go into the local scope.

local is a scope and will always exist within a method so in CF9 you don't need to define it as its already there.

Here is another sample block of code: