Hope to see you there!
Hope to see you there!
Apache™ FOP distributions are either pre-compiled binary or source. If you are using a binary distribution, it is already built and there is no need to build it again. See theDownload Instructions for information about whether a binary or source distribution is best for your needs.
If you got the source code from a repository snapshot or via Subversion you will need to build FOP in any case.
Building FOP requires a minimum Java Development Kit (JDK/SDK) of 1.4 (A Java Runtime Environment is not sufficient).
There is generally no need to setup a classpath. All libraries needed to compile FOP are included in the source distribution and are referenced by the build script. You will only need to adjust the classpath if you build FOP in some other way. See the build script build.xml for details.
The build script usesApache Ant, a popular Java-based build tool, which usually requires that the environment variable JAVA_HOME point to your local JDK root directory. This is true even if you use JDK 1.4 or above, which normally does not need this setting.
Apache Ant (Version 1.7 or later) must be installed in order to build FOP. Following best practices we don't include Ant with FOP anymore. You can find theinstructions to install Ant in the Ant manual on the web.
Change to the FOP root directory and build FOP by executing the build script (build.xml) using the "ant" command.
The file build.xml in the FOP root directory is the blueprint that Ant uses for the build. It contains information for numerous build targets, many of which are building blocks to more useful target, and others which are primarily used by the FOP developers. You may benefit from looking through this file to learn more about the various build targets. To obtain a complete list of useful build targets:
ant -projecthelpThe most useful targets are:
package: Generates the JAR files (default). This is the normal build that produces a jar file usable for running FOP.
clean: Cleans the build directory. This is useful for making sure that any build errors are cleaned up before starting a new build. It should not ordinarily be needed, but may be helpful if you are having problems with the build process itself.
javadocs: Creates the FOP API documentation.
To run the build:
ant [target ...]For example to do a normal build for the "all" target (which is the default):
antOR
ant allTo clean the build directory first:
ant clean allIf you have problems building FOP, please try the following:
Run the build with the target of "clean", then rerun the build.
Delete the build directory completely, then rerun the build.
Make sure you do not have a non-FOP version of xerces.jar, xalan.jar, batik.jar, or another dependency product somewhere in your CLASSPATH.
If the build still fails, see theGetting Help page for further help.
Copyright © 2025 The Apache Software Foundation, Licensed undertheApache License, Version 2.0.
Apache, Apache XML Graphics, Apache FOP, Apache Batik, the Apache logo, and theApache XML Graphics logos are trademarks ofThe ApacheSoftware Foundation. All other marks mentioned may be trademarks or registeredtrademarks of their respective owners.