Compiling FOP

Compilation is started by executing build, either as a batch file on win32 (build.bat) or as a shell script on unix. Before you can start one of these scripts, you have to setup your classpath and the environment variable JAVA_HOME (see below).

The compilation uses Ant, a replacement of make (you can find more information about Ant at jakarte.apache.org). build.xml is the replacement of makefile. Look there for detailed information on the build process and different targets.

A help screen is shown by calling "build usage".

If you only want to use Fop, you don't need to build it. A fop.jar comes with the distribution.

Setting up your classpath

The build process relies on finding following libraries in your classpath (the version numbers indicate that building with them has been successfully tested, other, later versions may work too:

- Xerces-J
  version 1.2.1 (xml parser)
- Xalan
  version 1.2 (xslt processor)
- bsf.jar (comes with Xalan)
- jimi.jar (image processing library) this file is optional

Other needed libraries and classes come with Fop (in xml-fop/lib), but the build script sets the path to them, so you only need to care about them, if you build Fop in any other way. See build.bat/build.sh for details.

A classpath for a complete compilation of Fop could look like this, if all these jar files are in a directory called jars (example uses windows syntax):

`set CLASSPATH=\jars\xalan.jar; \jars\xerces.jar; \jars\bsf.jar; \jars\jimi.jar;`

Setting of JAVA_HOME

You have to set the enviroment variable JAVA_HOME. It must point to your local JDK root directory. This is true, even if you use JDK 1.2 or above, which normally don't need this setting. It is used by Ant, the compilation software.

Problems

If you have problems compiling Fop, please try this first:

- delete the build directory completely and try a new build from scratch
- check, whether you have all necessary libraries in your classpath: xerces.jar, xalan.jar, bsf.jar, jimi.jar (optional)
- check, whether you have the required versions of Xerces (>= 1.2.1) and Xalan (>=1.2)
- check, whether you have an older version of xerces.jar, xalan.jar, w3c.jar somewhere in you classpath.

If you still have problems, please look at the page bugs, for further help.