aboutsummaryrefslogtreecommitdiffstats
path: root/src/documentation/content/xdocs/compiling.xml
blob: 27171035a61095e23bdc3ade77b665001e2cf195 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
<?xml version="1.0" standalone="no"?>
<!DOCTYPE document PUBLIC "-//APACHE//DTD Documentation V1.1//EN"
    "http://cvs.apache.org/viewcvs.cgi/*checkout*/xml-forrest/src/core/context/resources/schema/dtd/document-v12.dtd">

<document>
  <header>
    <title>FOP: Building from Source Code</title>
    <version>$Revision$</version>
  </header>
  <body>
    <section id="build-needed">
      <title>Do You Need To Build?</title>
      <p>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 the <link href="download.html">Download Instructions</link> for information about whether a binary or source distribution is best for your needs.
      </p>
    </section>
    <section id="env">
      <title>Set Up Your Environment</title>
      <section id="env-jdk">
        <title>JDK</title>
          <p>
            Building FOP requires a minimum Java Development Kit (JDK/SDK) of 1.3
            (A Java Runtime Environment is not sufficient).
          </p>
      </section>
      <section id="env-classpath">
        <title>CLASSPATH</title>
        <p>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 scripts (build.bat for Windows, and build.sh for Unix) for details.</p>
      </section>
      <section id="env-java-home">
        <title>JAVA_HOME</title>
        <p>The build script uses <link href="http://jakarta.apache.org/ant/">Ant</link>, a popular java-based build tool, which requires that the environment variable JAVA_HOME 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.</p>
      </section>
  </section>
  <section id="build-script">
    <title>Run the "build" Script</title>
    <p>Build FOP by executing the "build" script, which is located in the FOP root directory.
The Windows batch file is build.bat, and the Unix shell script is build.sh.
The examples below are for running the shell script, but except for the build file extension, the syntax is identical.</p>
    <p>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:</p>
    <source>build.sh -projecthelp</source>
    <p>The most useful targets are:</p>
    <ul>
      <li><strong>package</strong>: Generates the jar files (default). This is the normal build that produces a jar file usable for running FOP.</li>
      <li><strong>clean </strong>: 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.</li>
      <li><strong>javadocs</strong>: Generates javadocs. This creates the FOP API documentation.</li>
    </ul>
    <p>To run the build:</p>
    <source>build.sh [target ...]</source>
    <p>For example to do a normal build for the package target (which is the default):</p>
    <source>build.sh</source>
    <p>OR</p>
    <source>build.sh package</source>
    <p>To clean the build directory first:</p>
    <source>build.sh clean package</source>
  </section>
  <section id="problems">
    <title id="Troubleshooting">Troubleshooting</title>
    <p>If you have problems building FOP, please try the following:</p>
    <ul>
      <li>Run the build with the target of "clean", then rerun the build.</li>
      <li>Delete the build directory completely, then rerun the build.</li>
      <li>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.</li>
      <li>If the build still fails, see the <link href="gethelp.html">Getting Help</link> page for further help.</li>
    </ul>
  </section>
  </body>
</document>