#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2013
    Posts
    17
    Rep Power
    0

    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.
  2. #2
  3. No Profile Picture
    Moderator

    Join Date
    Jun 2002
    Location
    Raleigh, NC
    Posts
    5,264
    Rep Power
    968
    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.
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2013
    Posts
    17
    Rep Power
    0
    Originally Posted by kiteless
    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.
    And how am i going to call it? I saw something like

    <cfset myObject = createObject( "java", "to.library" )>

    <cfset result = myObject.getMethod()

    Is this correct?
  6. #4
  7. No Profile Picture
    Moderator

    Join Date
    Jun 2002
    Location
    Raleigh, NC
    Posts
    5,264
    Rep Power
    968
    Yes, the first parameter is "java", and the second is the fully-qualified class path to the class you want to create.
  8. #5
  9. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2008
    Posts
    131
    Rep Power
    7
    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.

IMN logo majestic logo threadwatch logo seochat tools logo