You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

compiling.xml 5.0KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. <?xml version="1.0" standalone="no"?>
  2. <!--
  3. Licensed to the Apache Software Foundation (ASF) under one or more
  4. contributor license agreements. See the NOTICE file distributed with
  5. this work for additional information regarding copyright ownership.
  6. The ASF licenses this file to You under the Apache License, Version 2.0
  7. (the "License"); you may not use this file except in compliance with
  8. the License. You may obtain a copy of the License at
  9. http://www.apache.org/licenses/LICENSE-2.0
  10. Unless required by applicable law or agreed to in writing, software
  11. distributed under the License is distributed on an "AS IS" BASIS,
  12. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. See the License for the specific language governing permissions and
  14. limitations under the License.
  15. -->
  16. <!-- $Id$ -->
  17. <!DOCTYPE document PUBLIC "-//APACHE//DTD Documentation V1.1//EN"
  18. "http://cvs.apache.org/viewcvs.cgi/*checkout*/xml-forrest/src/core/context/resources/schema/dtd/document-v12.dtd">
  19. <document>
  20. <header>
  21. <title>FOP: Building from Source Code</title>
  22. <version>$Revision$</version>
  23. </header>
  24. <body>
  25. <section id="build-needed">
  26. <title>Do You Need To Build?</title>
  27. <p>FOP distributions are either pre-compiled binary or source.
  28. 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.
  29. </p>
  30. </section>
  31. <section id="env">
  32. <title>Set Up Your Environment</title>
  33. <section id="env-jdk">
  34. <title>JDK</title>
  35. <p>
  36. Building FOP requires a minimum Java Development Kit (JDK/SDK) of 1.3
  37. (A Java Runtime Environment is not sufficient).
  38. </p>
  39. </section>
  40. <section id="env-classpath">
  41. <title>CLASSPATH</title>
  42. <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.
  43. 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>
  44. </section>
  45. <section id="env-java-home">
  46. <title>JAVA_HOME</title>
  47. <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 does not need this setting.</p>
  48. </section>
  49. </section>
  50. <section id="build-script">
  51. <title>Run the "build" Script</title>
  52. <p>Build FOP by executing the "build" script, which is located in the FOP root directory.
  53. The Windows batch file is build.bat, and the Unix shell script is build.sh.
  54. The examples below are for running the shell script, but except for the build file extension, the syntax is identical.</p>
  55. <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.
  56. You may benefit from looking through this file to learn more about the various build targets.
  57. To obtain a complete list of useful build targets:</p>
  58. <source>build.sh -projecthelp</source>
  59. <p>The most useful targets are:</p>
  60. <ul>
  61. <li><strong>package</strong>: Generates the jar files (default). This is the normal build that produces a jar file usable for running FOP.</li>
  62. <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>
  63. <li><strong>javadocs</strong>: Generates javadocs. This creates the FOP API documentation.</li>
  64. </ul>
  65. <p>To run the build:</p>
  66. <source>build.sh [target ...]</source>
  67. <p>For example to do a normal build for the package target (which is the default):</p>
  68. <source>build.sh</source>
  69. <p>OR</p>
  70. <source>build.sh package</source>
  71. <p>To clean the build directory first:</p>
  72. <source>build.sh clean package</source>
  73. </section>
  74. <section id="problems">
  75. <title id="Troubleshooting">Troubleshooting</title>
  76. <p>If you have problems building FOP, please try the following:</p>
  77. <ul>
  78. <li>Run the build with the target of "clean", then rerun the build.</li>
  79. <li>Delete the build directory completely, then rerun the build.</li>
  80. <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>
  81. <li>If the build still fails, see the <link href="../gethelp.html">Getting Help</link> page for further help.</li>
  82. </ul>
  83. </section>
  84. </body>
  85. </document>