August 9th, 2013, 09:30 AM
How to Call JAR files in Coldfusion 6
As the title says, how am i going to call/use a JAR files from Coldfusion Ver 6. How am I going to set my classpath/library. Most of what i've seen in the internet, it is being set in the coldfusion admin. But when I try to take a look on CF 6 admin, I cannot see those settings.
August 9th, 2013, 10:06 AM
The easiest thing to do is probably to drop the jar into one of the existing CF JAR folders that it already has on its classpath. Typically this is a /lib folder somewhere within the CF server or JRun directory. Since CF 6 is so old (11+ years) I can't tell you exactly where that is, but if you look under the CF server folder or do a search for "*.jar" you should find it.
August 9th, 2013, 10:20 AM
And how am i going to call it? I saw something like
Originally Posted by kiteless
<cfset myObject = createObject( "java", "to.library" )>
<cfset result = myObject.getMethod()
Is this correct?
August 9th, 2013, 10:45 AM
Yes, the first parameter is "java", and the second is the fully-qualified class path to the class you want to create.
August 9th, 2013, 12:55 PM
Just FYI, the path is case sensitive. For example if the class is "java.util.Date", this would not work:
<cfset x = createObject( "java", "java.util.daTe" )>
Note, method names are *not* case sensitive.