Warning!
Please understand that FMPP, as a bulk file processor, may generates high amount of output files, and overwrites all files with the same names as the names of output files without warning. It's a practical decision comes from the usage pattern of the tool. So watch where will the output files go.
Also note that, according the license, the author does not take responsibly if the usage of FMPP causes harm for you somehow.
Pre-requirements
- Java must be installed on your machine (version 1.4 or later). Note that Java is available for free, and on various platforms (Windows, OS X, "Linux", etc.), so FMPP works on many platforms.
- If you want to use the FMPP Ant task, you need Ant 1.5.1 or later. If you don't know what's Ant then don't worry, you will not need it.
Extracting
Extract the downloaded archive file (fmpp_X.X.X.tar.gz or fmpp_X.X.X.zip) into the directory where you prefer to store FMPP. For Windows users it is typically C:\fmpp or C:\Program Files\fmpp, for UN*X users it is typically ~/opt/fmpp or /opt/fmpp or /usr/lib/fmpp (where fmpp is the extracted fmpp_X.X.X directory after renaming). From now on I will refer to this directory as <FMPP_HOME>.
Setup the command-line tool
On Windows
The steps are:
- Extract the downloaded archive file (
fmpp_0.9.15.tar.gzorfmpp_0.9.15.zip) intoC:\Program Files\fmpp(note that "Program Files" may be shown in a localized form, like "Programme") orC:\fmppor wherever you prefer to. From now on I will refer to this directory as<FMPP_HOME> - For convenience, add
<FMPP_HOME>/binto thePATHenvironment variable. (How? Google: set path windows) - Check if
fmpp.batisn't present inC:\Windows(or in another directory in thePATH) from an earlier installation. Delete it if it does. - Check if the
JAVA_HOMEenvironment variable is set correctly (should point to your Java installation directory, not itsbinsubdirectory), or else that the intended version of thejavaexecutable is in thePATH. - To check that everything works, open a command line window and issue:
fmpp --version
Note: Because of the limitations of .bat files, you may get error messages as "The input line is too long". To solve this, install FMPP in a more "shallow" directory, so that the path to the FMPP related files will be shorter.
On UN*X (Linux, FreeBSD, OS X, etc.)
The steps are:
- Extract the downloaded archive file (
fmpp_0.9.15.tar.gzorfmpp_0.9.15.zip) into the/usr/lib/fmppor/opt/fmppdirectory (conventions vary by distribution), or wherever you prefer to. From now on I will refer to this directory as<FMPP_HOME>. - For convenience, create a soft link somewhere in the
PATH, likesudo ln -s <FMPP_HOME>/bin/fmpp /usr/bin/fmpp. - Issue
which fmppto see if it's not shadowed by an earlier installation elsewhere. - Check if the intended version of the
javaexecutable is in thePATH, or else that theJAVA_HOMEenvironment variable is set correctly (should point to your Java installation directory, not itsbinsubdirectory). - To check that everything works, open a command line window and issue:
fmpp --version
Notes
- If there's a
FMPP_HOMEenvironment variable, it<FMPP_HOME>\bin\fmpp.batand<FMPP_HOME>\bin\fmppwill use that directory instead of its own grandparent directory. - You can run FMPP without the provided shell scripts directly with the
javacommand, likejava -jar <FMPP_HOME>/lib/fmpp.jar. (You can also put all required jar-s and class directories into theCLASSPATHand then issuejava fmpp.tools.CommandLine.) Note though that you will lose console width detection with these approaches. - You can move the jars into the
libsubdirectory of Ant (if you want to use the Ant task anyway). If you do this, the command line tool need Ant be installed on a "standard" location (likeC:\Program Files\ant), orANT_HOMEmust be correctly set.
Setup the Ant task
If you want to use FMPP as Ant task, copy the required jar files from <FMPP_HOME>/lib into the lib directory of your Ant installation (issuing ant install from <FMPP_HOME> will do this for you), or ensure that the jars are in the CLASSPATH environment variable. Then, whenever you need the FMPP task in a project, add this line to your build.xml:
<taskdef name="fmpp" classname="fmpp.tools.AntTask"/>
And then you can use the <fmpp ...> task.
Installing optional parts and custom extensions
For the command-line tool, simply drop the jar file that contains the required classes into the <FMPP_HOME>/lib directory (or, into the Ant lib directory, if you store fmpp.jar there only). For the Ant task, either ensure that the required jars are in the CLASSPATH, or drop the jars into the lib directory of your Ant installation.
Updating FreeMarker
You can replace the included FreeMarker version with a later version. Download the latest backward compatible FreeMarker release, and overwrite <FMPP_HOME>/lib/freemarker.jar with the freemarker.jar of the FreeMarker release. (Of course, if you are using the FMPP Ant task, you may need to replace the freemarker.jar in the lib directory of the Ant installation too.)