AdobeStock_455007340

Upgrading ColdFusion To Java 7

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.

Note: If you are running 32bit ColdFusion on Windows you’ll need the Java 7 JDK instead of the JRE, on all other platforms the JRE will suffice.

(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 (or JDK 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.

19 responses to “Upgrading ColdFusion To Java 7”

  1. Justin Scott Avatar
    Justin Scott

    Perhaps not relevant to the level of user this post is targeting, but if you have imported any certificates into the JRE’s keystore make sure you import them into the keystore of the new JRE as well before updating ColdFusion’s settings to use it. Also related, if you’re using AES encryption with anything higher than a 128-bit key ensure you have the "unlimited strength" files installed into the new JRE as well or you will get "illegal key size" errors with encryption operations after you restart. This applies to any change of JVM with any version of ColdFusion.

  2. Dale Fraser Avatar
    Dale Fraser

    It certainly is a good improvement, updating things manually was painful.
    I’m looking forward to the new installers, which will presumably include jre 1.7 and the mandatory hotfix and revelant hotfixes.

  3. Tom Chiverton Avatar
    Tom Chiverton

    JRE ? I though ColdFusion required the full JDK ? Or is that only in CF9 ?

  4. Ben Forta Avatar
    Ben Forta

    Tom, you just need a JRE in ColdFusion 10.
    — Ben

  5. baillard Avatar
    baillard

    Ben, the Adobe website states JDK is required, not JRE "Download and install JDK 1.7." http://helpx.adobe.com/coldfusion/kb/coldfusion-10-update-8.html and "Note that ColdFusion requires the Java HotSpot Server virtual machine (jre/bin/server/jvm.dll), which is not available with the JRE download." http://helpx.adobe.com/coldfusion/kb/change-coldfusion-jvm.html

  6. Amanda Avatar
    Amanda

    I had to install the full JDK instead of just the JRE to get ColdFusion to start again. The server files weren’t there with the JRE.

  7. Ben Forta Avatar
    Ben Forta

    I’ve updated the post. It turns out that the JRE will indeed work for every platform except Windows running 32 bit Java. That is the only platform that does indeed need the full JDK.
    — Ben

  8. Jason Avatar
    Jason

    I was able to use JRE 1.7 u17 but had to copy msvcr100.dll from {JRE Home}jrebin to {ColdFusion-Home}runtimebin to get the ColdFusion application server service to start. Also, how do I confirm that I’m running the 64-bit version of ColdFusion? I know that I’m currently running 64-bit WS 2008 R2 w/ 64-bit JDK 1.6 u 24.

  9. Michael Avatar
    Michael

    Ben,
    You wrote "1.7.0_15 (or newer)", but an instruction (see
    http://helpx.adobe.com/coldfusion/kb/cumulative-hotfix-3-coldfusion-900.html)
    reads "ColdFusion 9.0 Cumulative hot fix 3 (Release date: March 8 2013) includes support for Google Maps JavaScript API v3 and JDK 1.7 Update 15".
    It doesn’t seem wise to use a Java update level beyond the one which if officially approved by Adobe. Please elaborate if you can. Thank you.

  10. Jim O'Keefe Avatar
    Jim O’Keefe

    I had the same experience as Jason. The Coldfusion application service would not restart after the switch to jre7. I copied the .dll file as he did and that worked.

  11. Ben Forta Avatar
    Ben Forta

    Michael, I’d not upgrade major versions, but minor versions are generally safer (as noted in the ColdFusion team post http://blogs.coldfusion.com/post.cfm/coldfusion10-jre-jdk-appropriate-usage).
    — Ben

  12. Paul Avatar
    Paul

    Thanks to Jason’s fix in comment #8, I was able to get Java 1.7.0_17 running on my Windows 2003 32-bit server with CF 9.0.1 (JRun4 multiserver installation). The CF service would not start until I copied msvcr100.dll to c:jrun4bin
    Also note there is no "Java and JVM" page under "Server Settings" in CF 9.0.1. I manually edited the jvm.config to point to the new 1.7.0_17 java install.

  13. Ian Avatar
    Ian

    What’s the trick to actually get it working on mac? Running 10.8.3, fully patched CF 9.0.2, java -version reports 1.7.0_17, but, no matter how I set the java.home either in the jvm.config or in my .bash_profile or via the CFIDE, CF refuses to use 1.7. Any tips?

  14. Kevin Benore Avatar
    Kevin Benore

    Ben, has the installer been updated to include the Java 7 bits? Or is that still some time away?

  15. Ben Forta Avatar
    Ben Forta

    Hot fixes won’t include a new installer, but future installers should indeed install JRE 1.7
    — Ben

  16. James Moberg Avatar
    James Moberg

    I installed JRE 1.7.0__21 (64bit) and couldn’t get CFInvoke to connect without throwing an Axis2 "length" error when attempting to connect to a ruby Axis1.4 service.
    I switched to JDK 1.7.0__15 and it now appears to be working fine (at least there’s no "length" error.)
    Has anyone encountered an error like this after upgrading Java? If so, is the problem with version 21 or is it possible that CF10 64bit does require JDK.

  17. Danny Avatar
    Danny

    Have you been able to get it to work with Java 1.7_45, which is the current update version? So far _15 is the only one that will allow the service to start back up.

  18. David Avatar
    David

    I would also like to know if anyone is using Java 1.7_45 on Win64/CF10.

  19. Anton Avatar
    Anton

    Java 1.7_45 on Win64/CF10 is working fine so far (JDK).
    Is it critical to install Java to the directory without spaces? I think, I had trouble to have JDK in Program Files directory.

Leave a Reply