Blog

13May
2004
Changing the ColdFusion JRE

Several months ago I posted an entry about changing the JRun JRE (http://www.forta.com/blog/index.cfm?mode=e&entry=1026). A couple of users have asked me how to change the ColdFusion JRE if using ColdFusion in standalone server mode (with embedded JRun). The instructions are actually, the same, just the path to the jvm.config file is different. The JRE path is stored in {CFMX root}/runtime/bin/jvm.config. To change the JRE, simply edit this file and set java.home to the desired path. Be sure to make a backup of the file first, and you'll also need to restart ColdFusion for the change to take affect.

Comments (17)



  • Juerg Anderegg

    for those having troubles installing a new JRE (like I did): With MX 6.1 you have to install the whole SDK, not only JRE, because ColdFusion needs a 'Hot-Spot JVM' which is not included in the JRE. If you only install the JRE and change the path in jvm.config to the new location, ColdFusion will start with an 'error 2' and you'll get an errormessage in {CFMX root}/runtime/logs/default-err.log like 'Error: no `server' JVM at c:/Program Files...'

    #1Posted by Juerg Anderegg | May 15, 2004, 07:35 AM
  • Alin Winters

    If you use SDK 1.3 you might get GCParallel option unknown error. Download a newer SDK. 1.4.2_04 works.

    #2Posted by Alin Winters | Jun 2, 2004, 11:35 AM
  • Imran Aziz

    This still does not work for us, I have Red Hat Linux 3.0ES with CFMX 6.1 installed on it, and I have tried using IBM SDK 1.4.2_04, but I keep on getting the error
    Error: no `server' JVM at `/opt/IBMJava2-142/jre/bin/server/libjvm.so'.

    Can anyone please guide me with how to sort this out, I have been trying for a very long time to sort this out, our CF Server crashes each night with Hot Spot Error and using IBM JVM seems to be the only solution to it.

    #3Posted by Imran Aziz | Dec 17, 2004, 08:13 AM
  • Lee Bryant

    Looking at the massive number of threads about the HotSpot error on CFMX/Linux/Sun JVM_1.4.2 it seems that CFMX takes down the JVM under any kind of decent load and, AFAIK, there are no fixes available.

    If IBM JVM 1.5 is not certified for use with CFMX then what can we do except give up on CF?

    Anyone know better?

    #4Posted by Lee Bryant | Jan 21, 2005, 05:42 AM
  • Ben Johnson

    We've had our share of troubles with HotSpot errors, so we tried the Java 1.5 JVM (from Sun) when it came out, and it seemed to stop the Hotspot problems.

    Wel, we recently upgraded to CFMX 7, and now the 1.5 JVM won't work! Is Macromedia going to either deal with these Hotspot problems, or at least certify CFMX7 with 1.5?

    #5Posted by Ben Johnson | Sep 1, 2005, 11:41 AM
  • Mark Brettin

    I just downloaded JDK 1.5 and tried to point my
    CFMX to it but I'm unable to get it to work. Has
    anyone gotten CFMX to work with 1.5?

    #6Posted by Mark Brettin | Oct 16, 2005, 07:06 PM
  • Samson

    These are the steps I used to get the server install of ColdFusion MX7 with embedded JRun
    working with the Sun JDK 1.5. This resolves such issues as "Unsupported major.minor version 49.0"
    when trying to instantiate a java object in ColdFusion that was compiled using Java 5.


    1. Download JRun4 Updater 6 from http://www.macromedia.com/support/jrun/updaters.ht...

    2. Make sure the ColdFusion service is stopped

    3. Install JRun4 Updater 6 into the runtime folder of your ColdFusion install directory.

    4. Download and install Java JDK 1.5

    5. Open the jvm.config file found in the runtime\bin folder under your ColdFusion install directory

    6. Find the line that sets the java.home property under the "VM Configuration" heading

    7. Modify this line to point to your JDK 1.5 home directory. Make sure to escape backslashes
    (example: java.home=C:\\Program Files\\Java\\jdk1.5.0_03)

    8. Reboot the computer

    #7Posted by Samson | Nov 9, 2005, 03:07 PM
  • Hans

    Out of curiousity, why:
    java.home=C:\\Program Files\\Java\\jdk1.5.0_03

    instead of:
    java.home=C:\\Program Files\\Java\\jdk1.5.0_03\\jre

    A few other related questions...

    * For 7.0.1, is JDK required or is JRE sufficient?
    * Is JDK 5.0 officially supported yet?
    * Any known issues using JDK 5.0 versus J2SE 1.4.2 SDK?
    * Is it best practice to install updates for JRun on a production server as they become available, or to wait for ColdFusion updates (which may include updates for JRun as well)? For example, as far as I know JRun4 Updater 6 isn't yet included in the latest ColdFusion update. Should it be applied to production servers anyway?

    #8Posted by Hans | Jan 12, 2006, 05:30 AM
  • Terry Ford

    << Looking at the massive number of threads about the HotSpot error on CFMX/Linux/Sun JVM_1.4.2 it seems that CFMX takes down the JVM under any kind of decent load and, AFAIK, there are no fixes available. >>

    We had a terrible time getting CFMX stable under load on linux. Finally, we found a JVM that worked.

    If you're running into hotspot errors under load, try Sun JVM 1.4.2_10

    What's strange is that versions AFTER 10 crash for us too. 10 is it.

    #9Posted by Terry Ford | Nov 5, 2006, 12:56 PM
  • Ted Daniels

    Unsupported major.minor version 49.0"

    I tried the suggestion by Samson, tried pointing the jvm.config file to programfiles\\java\\jdk... and ColdFusion server refuses to start. CHecked the JRUN4\bin and it had the same patch as the CFMX\Runtime\lib\jvm.config, albeit the JRUN file had the path written as c:/program files/java/jdk....

    Either CF server won't start (if I edit jvm.config) or I can't point to the JDK and get the "Unsupported major.minor vesion 49.00". Any suggestions welcome.

    Ted Daniels

    #10Posted by Ted Daniels | Nov 25, 2006, 03:01 AM
  • Wil Genovese

    Which JVM HotSpot crashes are you (et all) seeing?

    The only HotSpot crash we see starts out like this: (if anyone want to see the whole thing I can email it to you upon request.)

    #
    # An unexpected error has been detected by HotSpot Virtual Machine:
    #
    # SIGSEGV (0xb) at pc=0x405416dc, pid=24366, tid=16384
    #
    # Java VM: Java HotSpot(TM) Server VM (1.4.2_12-b03 mixed mode)
    # Problematic frame:
    # V [libjvm.so+0x3b16dc]
    #

    --------------- T H R E A D ---------------

    Current thread (0x08060d58): JavaThread "DestroyJavaVM" [_thread_blocked, id=24366]

    #11Posted by Wil Genovese | Jan 16, 2007, 01:36 PM
  • Timothy Rubel

    This fixes ERROR "Unsupported major.minor version 49.0" and "Unsupported major.minor version 50.0" on my Windows Server 2003 SP1 and Coldfusion MX 7.02 system.

    1. Make sure the ColdFusion service is stopped.

    2. Download JRun4 Updater from http://www.macromedia.com/support/jrun/updaters.ht......
    jrun4-win-en-updater.exe

    3. Install JRun4 Updater into the runtime folder of your ColdFusion install directory.
    C:\CFusionMX7\runtime

    4. Download and install Java JDK 1.5 ( jdk-1_5_0_11-windows-i586-p.exe )

    5. Open both jvm.config files found in these directories:
    C:\CFusionMX7\runtime\bin
    C:\CFusionMX7\runtime\updater6-backup\bin

    6. Find the line that sets the java.home property under the "VM Configuration" heading ( change "java.home=C:/CFusionMX7/runtime/jre" to "java.home=C:/Program Files/Java/jdk1.5.0_11/jre" in both files.

    7. Restart coldfusion.

    It took me week reading Adobe forums and I finally found part of the answer in Samson's post above. I hope this saves you all time.

  • Kathy

    Just a comment to an earlier post - if you point to a JDK, you do want to point to the JDK root, and not the JRE folder inside the JDK root.

    The steps posted by Samson worked perfectly for me. I'm using ColdFusion 6 with the default JRun from the download. I developed code in Java 5.

    #13Posted by Kathy | Apr 12, 2007, 10:02 AM
  • Matt

    If you don't feel like changing the JRE version, you can also just recompile the java source using the -source <version> to make it compatible with a lesser version of Java... e.g 'java -source 1.4 -classpath ...' would make it compatible with Java 1.4

    #14Posted by Matt | May 2, 2007, 01:42 PM
  • how to play virtual roulette machines

    The person who create this post he is a great human..thanks for shared this with us.i found this informative and interesting blog so i think so its very useful and knowledge able....
    http://www.topvirtualroulette.com

  • Anna

    >I just downloaded JDK 1.5 and tried to point my
    >CFMX to it but I'm unable to get it to work. Has
    >anyone gotten CFMX to work with 1.5?

    Try set

    -Djmx.invoke.getters=true

    to the JVM arguments.




    Anna
    _______________________
    http://skylinemp3.com/

    #16Posted by Anna | Nov 27, 2009, 09:09 AM
  • replica hangbags

    http://www.mybagsvip.com
    http://www.mybagsvip.com/louis_vuitton-bags.html" target="_blank">http://www.mybagsvip.com/louis_vuitton-bags.html
    http://www.aimbags.com
    http://www.aimbags.com/louis_vuitton-bags.html
    http://www.handbagssell.com
    http://www.handbagssell.com/Louis_Vuitton-bags.html" target="_blank">http://www.handbagssell.com/Louis_Vuitton-bags.htm...