Protégé Build Instructions
This documentation is targeted toward users who would like to compile the Protégé source code using an Ant build file. You can retrieve our source code in one of two ways:

- A stable version of the source code is made available in ZIP file format on the Downloads page of our Web site each time we do a build. After unzipping the source code, you will find the Ant build file "build.xml" in the root directory.
- Bleeding-edge versions of our source code can be downloaded from our Subversion repository. If you're new to Subversion, we offer detailed documentation on downloading from our repository elsewhere. To get the source code from Subversion and successfully use the Ant build file, you must issue the following command:
  `svn checkout http://smi-protege.stanford.edu/repos/protege/protege-core/trunk <your-destination-dir>`
  After checkout, the Ant build file "build.xml" will be located in the root directory. Issuing the above command ensures that the proper directory structure will be created for running the Ant build file.

System Requirements
Before building Protégé, you must have the following software installed on your system:

- The Java Development Kit (version 1.4 or higher). Make sure to set the JAVA_HOME environment variable to the installation directory of your JDK.
- The Apache Ant Java-based build tool. See Apache's Web site to download Ant. The download includes installation instructions for all platforms. The Ant build script we distribute was developed with Ant version 1.5.1. It should work on higher versions of Ant but has not been tested on previous versions.
- The Java Compiler Compiler (a.k.a "JavaCC" or "The Java Parser Generator"). JavaCC is available for download through java.net.

Source Package Structure
Pertinent files in Protégé's source package:

build.xml | Ant build file
local.properties.template | Properties file contaning variables used by the Ant build file
readme.html | Build instructions
/bin/Parser.jj | Grammar file used by JavaCC during the compile process
/lib | Directory containing third party libraries needed to compile the Protégé source code
/src | Directory containing the Protégé source code

Initiating a Build
Steps for initiating a build:

1. From the command line, change into the installation directory (where the Protégé source code was unzipped).
2. Rename local.properties.template to local.properties. We added the ".template" extension so that each time the source code is downloaded, the local.properties file is not overwritten which causes user defined settings to be lost.
3. Open local.properties and set the javacc.home variable to the location of your JavaCC installation directory.
4. To start the build process, type "ant all".

When the build is finished, there are several resulting items:

/classes | Directory containing compiled Protégé source files
/dist | Directory containing the newly generated Protégé JAR file as well as source and binary distributions of Protégé packaged in ZIP format
/docs/apidocs | Directory containing the newly generated Protégé API documentation (javadoc)

It's also possible to run various parts of the build separately. For a list of available targets, type "ant" on the command line.