Building
Do You Need To Build?
The AFP Renderer is distributed with a pre-compiled binary jar inside the dist directory, so compiling and packaging the binary jar should not be necessary. However, if you want to make changes to the source code, the following information will explain how to create the jar.
Set Up Your Environment
Java Development Kit
Building the AFP Renderer requires a minimum Java Development Kit (JDK/SDK) of 1.3 (A Java Runtime Environment is not sufficient).
Ant
A recent version of Ant is required to build the AFP Renderer using the supplied build scripts. Ant can be set up by downloading a copy from http://ant.apache.org/ and following the installation instructions provided.
Note that Ant requires that the JAVA_HOME
environment
variable point to your local JDK root directory. This is true even if you
use JDK 1.2 or above, which normally does not need this setting.
CLASSPATH
There is generally no need to setup a classpath. All libraries needed to compile the AFP Renderer are included in the distribution and are referenced by the build script. You will only need to adjust the classpath if you build the AFP Renderer in some other way. See the build script (build.xml) for details.
Run the "build" Script
Build the AFP Renderer by running the ant build.xml script, which is located in the top level directory as extracted from the distributed zip. The file build.xml is the blueprint that Ant uses for the build. It contains information for numerous build targets, many of which are building blocks to a more useful target, and others which are primarily used by 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, run the following command:
ant -projecthelp
The most useful targets are:
- clean
- Removes generated files, such as jars, classfiles and documentation
- dist
- Builds the distributable jar
- javadoc
- Generates the API documentation from the code
To run the build:
ant [target ...]
For example, to do a normal build for the dist target (which is the default):
ant
OR
ant dist
To clean the build directory first:
ant clean dist
Troubleshooting
If you have problems building the AFP Renderer, please try the following:
- Run the build with the target of "clean", then rerun the build.
- Make sure you do not have alternative versions of xerces.jar, xalan.jar, batik.jar, or another dependency jar somewhere in your CLASSPATH.
- If the build still fails, try contacting the developers on the mailing lists.