Saturday, January 26, 2013

Calling Java 7 from Cold Fusion

I tried calling Java 7 objects from Cold Fusion10  today and I got nothing ...  Literally, nothing.  At the CFOBJECT tag, the script would just die.  No error message.  Nothing in the log files.  Just nothing.

I made a Java 7 object, one class, one method, nothing special...Same results.  Then I converted that project (one class) to JDK 6, and poof!  The same object compiled using JDK6 works fine! 

http://blogs.coldfusion.com/post.cfm/java-7-support-for-coldfusion

The above article states that CF 9 and 10 will support Java 7 through updates by February 2013 ... we'll we're getting close.  I just downloaded all the updates and ...

Fail!

Even with all updates applied, the script just dies when i try to call Java 7 objects from CF 10.  So now I've got all of this code written for JDK7, and I need to call it from CF10 ... What to do ...  Looks like I might be converting a lot of code written for JDK7 to work with JDK6, which sucks, because I like try-with-resources, and I like the diamond operator ... a lot :(

2 comments:

  1. I've been running Java 7 in my development environment for awhile now with no issues. Not brave enough to go live with it yet, but thinking about it. You just need to install JDK7, open your jvm.config, switch the java.home to your new install jre, restart.

    Mine looks like this:
    #java.home=I:/ColdFusion/jre
    java.home=C:/Program Files/Java/jdk1.7.0_11/jre

    ReplyDelete