## Source Installation Requirements

You must have the following in order to build a FUSE product from its source distribution:

- An active connection to the Internet. The build system uses the Maven build engine, which connects to one or more Maven repositories on the Internet to download JAR files that are determined to be dependencies of the current build.

- A Java 5 JDK

- Apache Maven 2

- Apache Ant

### Java 5 JDK

You must have installed a Java Development Kit (JDK), version 1.5.0_11 or later. You can download the JDK from http://java.sun.com/javase/downloads/previous.jsp.

Once you have installed the JDK you must:

1. Set the `JAVA_HOME` environment variable to point to the top-level directory containing your JDK.

2. Add the JDK's `bin` directory to the `PATH`.

On Windows, the Sun JDK installs by default into `C:\Program Files\Java\jdk1.5.0_`version``. When specifying this path in your `JAVA_HOME` environment variable, you can use `Progra~1` instead of `Program Files`, as shown in the example scripts below.

### Apache Maven

Apache Maven is a popular build management tool. FUSE source builds require Apache Maven 2.0.9 or later; you can download Apache Maven from http://maven.apache.org/download.html.

Once you have installed Apache Maven, you must:

1. Set the `M2_HOME` environment variable to point to the top-level directory containing your Maven installation.

2. Add Maven's `bin` directory to the `PATH`.

3. Set the `MAVEN_OPTS` environment variable to `-Xmx512M` to give the Maven build more memory in which to run.

### Apache Ant

Building FUSE source and sample code also requires Apache Ant. The source build requires Apache Ant 1.6.5 or later; you can download it from http://ant.apache.org/bindownload.cgi.

After unzipping the Apache Ant distribution, you must:

1. Set the `ANT_HOME` environment variable to the top-level directory where you unzipped Apache Ant.

2. Add Apache Ant's `bin` directory to your PATH.

| Tip
The archive file containing Maven unpacks into a directory named with the Maven version number, such as `maven-2.0.9`. Likewise, the Ant distribution unpacks by default into a directory such as `apache-ant-1.7.0`. You can plan ahead for future releases by unpacking these distributions to a temporary location, then copying their contents into unversioned directory names, such as (for Windows) `C:\Maven` and `C:\Ant`. On UNIX, you can unpack the distribution to `/opt/maven-2.0.9`, then create a symbolic link from `/opt/maven` to `/opt/maven-2.0.9`. That way, when you decide to download a newer release, you can repeat this process to copy or link to the latest release, without having to change your environment settings.

### Example Scripts

You can make all settings for the required programs with a script like the following examples. Adjust the paths in these examples to reflect your actual installed locations of Ant, Maven, and the JDK.

Example 3.1. Windows Environment Script

    set JAVA_HOME=C:\Progra~1\Java\jdk1.5.0_11
    set ANT_HOME=C:\Ant
    set M2_HOME=C:\Maven
    set PATH=%JAVA_HOME%\bin;%PATH%
    set PATH=%ANT_HOME%\bin;%PATH%
    set PATH=%M2_HOME%\bin;%PATH%
    set MAVEN_OPTS=-Xmx512M

Example 3.2. UNIX and Linux Environment Script

    export JAVA_HOME=/usr/lib/jvm/java-1.5.0-sun
    export ANT_HOME=/opt/ant
    export M2_HOME=/opt/maven
    export PATH=$JAVA_HOME/bin:$PATH
    export PATH=$ANT_HOME/bin:$PATH
    export PATH=$M2_HOME/bin:$PATH
    export MAVEN_OPTS=-Xmx512M