Installing FreeMarker

No real installation is needed. Simply ensure that freemarker.jar is somewhere where your Java application's class-loader will find it. In web application this usually means putting freemarker.jar into the WEB-INF/lib directory of your web application. (If you want to use FreeMarker with JSP Model-2 style (which also means that you can use custom JSP taglibs in the templates), some extra steps needed. For more information please see the chapter about servlets.)

FreeMarker has no required dependencies. But to use certain optional FreeMarker features, the related party libraries have to be available for the class-loader:

  • Jaxen (recommended, download here) or Apache Xalan is needed for XML XPath support. Please use at least Jaxen 1.1-beta-8, not older versions! Apache Xalan classes are included in a package-relocated form in Sun/Oracle J2SE 1.4-1.8 (maybe later too), and FreeMarker will use those if it doesn't find Jaxen or Xalan elsewhere. But as Oracle can change these internal packages anytime, it's still recommended to use an external Jaxen or Xalan.

  • Obviously, javax.servlet classes are needed for FreemarkerServlet . Servlet version 2.2 or later is needed.

  • For the custom JSP taglib support, you will need JSP 2.0 API or later avilable. No JSP implementation is needed, just the API. This is already present in pretty much every servlet container. For more information please see the chapter about servlets.

  • Jython 2.0 or later classes are needed for the Jython wrapper.

  • Pre-1.0 JDOM is needed for the long deprecated freemarker.ext.jdom package. (When it was created, there was no JDOM 1.0 yet.)