Skip to content

Class name for Liquide / Liqp Project in Lucee / Coldfusion,

I’m trying to use the Liquid template engine in coldfusion and I’m not sure what “class name” to use when creating the java object in lucee

Relevant Documentation
Liqp Project:
Lucee Doc:
Jar File:

jLiq = createObject("java","Liquid", expandPath('/app/lib/liqp-0.7.9.jar'))

for the 2nd parameter, classname, I’ve tried many combinations(liqp,Liquid,liqp-0.7.9,liquid.parser,etc), but nothing seems to work, I’ve inspected the jar file for ideas. Anybody have any ideas on how to reference this java object in coldfuison?



The JAR on MVN Repository isn’t bundled with its dependencies, so you either put everything into a single fat JAR or specify a folder with all the single JAR files. Once you’ve done that, you need to create class objects by specifying package + classname:


    LiquidTemplate = createObject("java", "liqp.Template", expandPath("liqp-0.7.9.jar"));

    template = LiquidTemplate.parse("hi {{name}}");
    rendered = template.render({ "name": "tobi" });

    writeOutput(rendered); // hi tobi


As a side note: Why would you use a template engine when you are already on CFML?

1 People found this is helpful