Back to FOPProjectPages.

IDE Setup Guide

This page tells you how to setup FOP for development in an IDE.

Eclipse (3.x)

For the following to work you'll need the Subclipse plug-in which you can get through the following update site:

Importing an existing FOP checkout into Eclipse

Checking out inside Eclipse

Setup SVN Repository location

Anonymous access

Committer access

Work on the Trunk

Download the project files

Setup source directories and libraries

In order to enjoy the automatic compilation feature of Eclipse, you have to define source directories and add libraries in the project preferences ("source" and "libraries" tabs). Because FOP uses Java code generated from XML in the src/codegen directory, you'll still have to run the "codegen" target in the buildfile. The generated code is written to the build/gensrc directory. See notes below on adding source directories before you do this. Here is how you do it:

Open the Java Build Path of the Project

Add the following directories as source directories:


Note: If you haven't followed the above instructions, it might happen that eclipe will not set the project as a Java Project. You might want to try this hack:


Work on the Maintenance Branch

Due to the current directory layout, setting FOP in Eclipse is a headache, you'll have to use exclude paths because src/org and src/java-1.4/org overlap.

Download the project files

Setup source directories and libraries

See the setup in the "Work on the Trunk" section, however, you have to carefully set exclusion masks for

You have to run an external Ant with both the targets of gensrc and prepare-compile, and clean out some of the superfluous generated files which Eclipse marks as conflicting.

General setup


The following setup is required for smooth work on the project, both for committers and users providing patches. Choose Windows->Preferences.

Ant support

Seems to be working now.

Checkstyle support

Download the Eclipse Checkstyle plug-in.

After installing the plug-in go to the Preferences dialog and to the Checkstyle section. Import the checkstyle config file from FOP's root directory. Adjust the path of the checkstyle.header.file entry.

Tip: Set a file filter (".*/gensrc/.*") in the Checkstyle section of the project's Properties page. This avoids a lot of unavoidable style violations due to code generation.

PMD support

PMD is similar to CheckStyle. It allows more powerful rules but configuring them is more difficult. It also comes with a nifty copy'n'paste detector.


Details of JBuilder setup to come.

Checkstyle setup (for JBuilder)

Download jbCheckstyle, an Open Tool for JBuilder that provides integration of JBuilder and Checkstyle, from: After unzipping the contents, the README.html file contains complete instructions for installation and configuration.

Be sure to adjust the path of the checkstyle.header.file entry, and use forward slashes for directory delimiters (even if you are running on a Windows platform). Failure to correctly configure this will cause jbCheckstyle to not provide any output.

NetBeans (4.1)

Work on the Trunk

NetBeans 4.1 or later is recommended as this is the first NetBeans version supporting multiple source root directories. This allows to work with the unchanged FOP directory layout.

For the following to work you'll need the Subversion profile installed in NetBeans which you can get through the following update site:

Download the project files

Checkout the trunk from Subversion into an empty directory from now on referred to as $FOP_HOME. Download / install any additional libraries like JAI and/or Jimi. The simplest way is to put them into the $FOP_HOME/lib directory. One can also create a file in $FOP_HOME, define the property <property name="optional.lib.dir" value="<path to optional lib directory>"/> in that file, and put the non FOP supplied libraries in that directory. Now do a command line build of FOP using ant.

Setup the project in NetBeans

To import this into NetBeans following these steps:

Connect the project to Subversion

Open the Versioning Manager (Versioning / Versioning Manager) and click on Add.

Checkstyle support

Download and install the NetBeans 4.0 Checkstyle plug-in. Under Tools/Options/Building/Checkstyle Settings set the Checkstyle Properties file location to the checkstyle.xml that comes with the SVN checkout of FOP.

Setup for NetBeans (6.5)

Netbeans 6.5 or later has built in support for SVN (Subversion). SVN allows you to work on the latest trunk version of Apache's FOP. See for more information on SVN.

This tutorial assumes you are familiar with Netbeans, Apache's Ant and SVN. In order to set up the FOP in Netbeans 6.5, you will need the following installed:

* Apache Ant

* Netbeans 6.5

* Java Advanced Imaging Binary Builds For windows, download jai-1_1_2_01-lib-windows-i586.exe (this needs to be installed).

* Saxon (saxon9-dom.jar)

Check out the trunk

* Start Netbeans 6.5

* Click 'Versioning', 'Checkout'

* The check out dialog box will open. In the Repository URL put:

* Click 'Next'

* In the local Folder textbox, choose a location where you want the trunk version to be downloaded to. You will need to remember this location for when you create your Netbeans project.

* The check out process may take several minutes. After checking out the trunk, you will need to do an Ant build.

Run an Ant build

* Do an Ant build of the trunk that you downloaded.

Creating the Project

* In Netbeans, click 'New Project'

* The New Project dialog box opens.

* In the Catagories, choose 'Java" and then choose "Java Project with Existing Sources' from the projects window.

* Click 'Next'

* The 'Java Project with Existing Sources' dialog will open.

* In the Project Name textbox, give your project a name (e.g. Fop).

* Choose your Project Folder.

* Click 'Next'

* Now you will need to add your Existing Sources. * Click the 'Add Folder'

* Navigate to where you downloaded the trunk to. (e.g. c:\foptrunk2)

* Add the Folders: ( this assumes your downloaded version of Fop Trunk is c:\foptrunk2

- c:\foptrunk2\src\java

- c:\foptrunk2\build\gensrc

* Click 'Next'

* The next step is the Includes and Excludes dialog.

* Give Netbeans a few minutes to load all the included files.

* Click 'Finished'

* Now, netbeans will create the project. When Netbeans finishes, you will notice a number of resources missing:

* You will need to a number of dependencies for your project.

* Jai (by default (windows) located in 'C:\jai-1_1_2_01\lib')

- jai_codec.jar

- jai_core.jar

- mlibwrapper_jai.jar

* Saxon

- saxon9-dom.jar (Download from and place in the your \lib folder of the fop trunk e.g. c:\foptrunk2\lib)


- avalon-framework-4.2.0.jar

- batik-all-1.7.jar

- commons-io-1.3.1.jar

- commons-logging-1.0.4.jar

- saxon9-dom.jar

- serializer-2.7.0.jar

- servlet-2.2.jar

- xalan-2.7.0.jar

- xercesImpl-2.7.1.jar

- xml-apis-1.3.04.jar

- xml-apis-ext-1.3.04.jar

- xmlgraphics-commons-1.4svn.jar

* Ant

- ant.jar (located in the ant director e.g. c:\ant\lib)

* Netbeans will take a few minutes to import the resources.

* If all goes well, you will see:

* That's it! Good Luck.

FOPIDESetupGuide (last edited 2009-09-20 23:52:09 by localhost)