Performance Zone is brought to you in partnership with:

Ben Forta is Adobe Inc.'s Director of Platform Evangelism, and has over two decades of experience in the computer industry in product development, support, training, and marketing. Ben is the author of the best-selling ColdFusion Web Application Construction Kit series, as well as books on SQL, Regular Expressions, Java Server Pages, WAP, Windows development, and more. Over 1/2 million Ben Forta books have been printed in fifteen languages worldwide. Ben co-authored the official ColdFusion training material, as well as the certification tests and official study guides for those tests, writes regular columns on ColdFusion and Internet development, and now spends a considerable amount of time lecturing and speaking on application development worldwide. Ben is a DZone MVB and is not an employee of DZone and has posted 45 posts at DZone. You can read more from them at their website. View Full User Profile

Upgrading ColdFusion To Java 7

  • submit to reddit

ColdFusion 10 shipped with Java version 6 (also referred to as JRE 1.6). And until recently, ColdFusion 9 and 10 users had to use Java 6 and could not upgrade to Java 7 (JRE 1.7). But Oracle recently announced that Java 6 is no longer being updated as of the end of February 2013, which is why it was so critical for us to release updates for ColdFusion 9.x and ColdFusion 10 to provide support for JRE 1.7.

Now that ColdFusion supports Java 7, you should indeed upgrade, and (as requested by several ColdFusion users) here are some instructions and pointers.

ColdFusion ships with a Java runtime, and that's most likely what your ColdFusion server is using. To upgrade the JRE you actually leave the existing one intact (which makes it possible to easily restore to the prior state if something goes wrong). When you upgrade the Java runtime you install a new copy of Java, and then tell ColdFusion to use it instead of the one used previously.

(Obviously, make sure you have backups, and you probably don't want to make these changes during peak use time, this is definitely an off-peak type of upgrade).

Ok, here's what you need to do ...

  1. ColdFusion stores the path of its Java runtime in /cfusion/bin/jvm.config. Make a backup of this file! That way, if something goes wrong, you can simply stop ColdFusion, restore that file, restart ColdFusion, and you'll be back up and running as if you'd have changed nothing at all.
  2. Download JRE 7 on to your ColdFusion server. Make sure you pick the right version for your OS. If you are using 32bit ColdFusion you must install the 32bit JRE, and if you are using 64bit ColdFusion you must install the 64bit JRE. (Pay attention to the 32bit versus 64bit decision, on a 64bit machine the page may default to 32bit if it detects you are using a 32bit web browser).
  3. Once you have downloaded JRE 1.7, install it on your server.
  4. Note the JRE 1.7 installation folder, you'll need the full path to it.
  5. Log in to ColdFusion Administrator.
  6. Go to the Server Settings > Java and JVM page.
  7. Replace the Java Virtual Machine Path with the path to the newly installed JRE 1.7 (you can also click Browse Server to locate the folder), then click Submit Changes.
  8. You will be instructed to restart ColdFusion, so do that.
  9. Once ColdFusion has restarted, log back into the ColdFusion Administrator and go to Server Settings > Settings Summary. In the JVM Details section Java Version should indicate that you are running 1.7.0_15 (or newer).

That's all there is to it! Obviously, you should test that your sites and apps are all working properly. And as noted previously, if something is not working, you can always stop ColdFusion, restore the jvm.config file, and then restart, to return ColdFusion back to its pre-upgraded state.

Published at DZone with permission of Ben Forta, author and DZone MVB. (source)

(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)