Build Guide
Description
If you have not yet downloaded and installed the latest distribution of the toolkit, you will need to do so before continuing the build process. The Installation Guide also describes the system requirements.
See also: Downloads, Installation Guide, Build Guide, Programmer's Guide, Toolkit API.
Building
All of the more popular IDEs support a Java build mechanism called Ant. Ant is a cross-platform build tool that enables Java programs to be compiled and packaged in a standardized non-platform-specific way. In fact, Ant itself is written in Java. Ant uses an XML file (by default, called "build.xml") to describe the build steps for a package. Build targets inside this file can be invoked either from within an IDE environment or directly from a command line.
For the remainder of this guide, we will describe how to invoke the build targets using the Ant command line tool since this will work the same way on all platforms. We will leave it to those using an IDE to read you're documentation for instructions on invoking ant from within your IDE.
Building with Ant
Download Ant
If you do not already have the Ant package installed on your development computer, you will first need to download a copy of Ant:Install Ant
After you download the Ant package, you will need to extract the distribution files from the downloaded archive and then set up your operating system's PATH environment to be able to run the ant command line tool:Compiling MBT with Ant
In order to invoke the ant command line tool to compile the MBT project, you will need to open a command shell on your system, then change directories to the top level of the MBT project, then simply run the ant command with no arguments:% cd MBT_HOME
% antMBT Ant Targets
The ant "build.xml" file supplied with the MBT package includes a number of build targets that developers should find useful. Some additional targets are also included which are primarily used by the authors for packaging various toolkit distributions.You can invoke an ant target by simply including the target name on the ant command line:
% ant TARGET
Target Description classes Compile the MBT library classes. examples Compile the MBT examples. compile Compile the MBT classes and examples. docs Build the MBT API documentation. clean Clean up the built MBT files. The remaining targets are primarily used by the MBT authors and require external Perl scripts to operate (not supplied). But, the targets are documented here for completeness.
Target Description test Test all the MBT example programs. apps Generate WebStart applications. distrib Package MBT distribution files into JAR archives. www Copy MBT distribution files into ${www} tree. all Build and test all MBT components.
Quick-and-Dirty Build
If you're really anxious to get moving and you just want to have a quick-and-dirty method to build the toolkit, there is a way.
On all supported platforms except Windows (ie: on all UNIX systems), you can build the toolkit by running the following commands:
cd srcfind edu org -name "*.java" > source_listjavac @source_listThis will generate a complete list of source files and compile the resulting list of files. The class files will be placed into the same directory as each of the source files. This is not something that we would recommend doing in a "clean" development environment, but it will get you going quickly and confirm that you an build the toolkit on your system.
Subsequently, you can then generate the javadoc API documents by running the following additional command:
javadoc @source_listAgain, this will generate a complete set of documents and the resulting html files will be placed into the same directory as each of the source files. You can open the "index.html" file in your favorite web browser to view the documentation.
To build the examples, you can run the following additional commands:
cd ../examplesjavac -classpath ".:../src" *.javaFinally, you can try running one of the examples:
java -classpath ".:../src" ExplorerMost developers should continue by reading the Programmer's Guide.
