@page title="Installing" keywords="installing, install, setup"> <@sect title="Warning!">
Please understand that FMPP, as a bulk file processor, may generates high amount of output files, and <@e>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 <@a href="license.html">the license@a> (BSD), the author does not take responsibly if the usage of FMPP causes harm for you somehow.
@sect> <@sect title="Pre-requirements">Extract the downloaded archive file (<@c>fmpp_<@r>X@r>.<@r>X@r>.<@r>X@r>.tar.gz@c> or <@c>fmpp_<@r>X@r>.<@r>X@r>.<@r>X@r>.zip@c>) into the directory where you prefer to store FMPP. For Windows users it is typically <@c>C:\fmpp@> or <@c>C:\Program Files\fmpp@>, for UN*X users it is typically <@c>~/opt/fmpp@> or <@c>/opt/fmpp@> (where <@c>fmpp@c> is the extracted <@c>fmpp_<@r>X@r>.<@r>X@r>.<@r>X@r>@c> directory after renaming). From now I will refer to this directory as <@c><@r><FMPP>@>@>.
@sect> <@sect title="Setup the command-line tool" anchor="commandLineTool"> <@sect title="Windows (95/98/Me, NT/2000/XP, ...etc.)">
Quickly and simply: If you have unpacked FMPP into the <@c>C:\Program Files\fmpp@c> (or <@c>C:\Programme\fmpp@c>) or the <@c>C:\fmpp@c> directory, then just copy <@c><@r><FMPP>@>\bin\fmpp.bat@c> into <@c>C:\Windows@c> (if that's the Windows directory on your installation... some systems use <@c>C:\WinNT@c> or <@c>C:\Win_ME@c>). Now you can use the <@c>fmpp@c> command in the command-line anywhere. That's all.
Note the <@c>java.exe@c> (this comes with Java) must be in the path, or the <@c>JAVA_HOME@c> environment variable must be correctly set. Otherwise <@c>fmpp.bat@c> will fail when it tries to invoke <@c>java.exe@c>.
If the above was not good for you, or you run into some problems, then read on...
To run FMPP from command-line, execute <@c><@r><FMPP>@>\bin\fmpp.bat@>. You should put the <@c><@r><FMPP>@>\bin@> into the path, so you can issue an <@c>fmpp@> command from anywhere. Or, just drop <@c>fmpp.bat@c> into a directory which is already in the path (say, into the Windows directory), if <@c><@r><FMPP>@>@> is <@c><@r><SystemDrive>@r>:\fmpp@> or <@c><@r><SystemDrive>@r>:\Progra<@r><AnythingLongerThan2Characters>@r>\fmpp@> (e.g. <@c>C:\Program Files\fmpp@>).
For those of you who don't know how to set the path: To set the path in Windows NT/2K/XP, use Control Panel/System/Advanced/Environment variables, and edit the <@c>PATH@c> variable (upper/lower-case differences doesn't matter). To set the path in Win9x, add line
<@c>set PATH=%PATH%;<@r><FMPP>@r>\bin@c>
to the end of <@c>C:\autoexec.bat@c>. You should restart Windows if the changes do not take effect.
Because of the limitations of <@c>.bat@c> 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 is shorter.
Windows 95/98/Me users please note: Because of the deficiencies of the shell, there are limitations regarding <@c>fmpp.bat@c>:
Anybody contributes with a good convenient installer ("setup.exe" built with Install Shield Wizard or something) is welcome.
@sect> <@sect title="UN*X (Linux, FreeBSD, Solaris, Mac OS X, ...etc.)">To run FMPP from command-line, execute <@c><@r><FMPP>@>/bin/fmpp@>.
You may want to create a soft link in a directory that is in the common <@c>PATH@c>, such as <@c>/bin@c>, so users can issue an <@c>fmpp@> command from anywhere:
<@c>ln -s <@r><FMPP>@>/bin/fmpp /bin/fmpp@c>
@sect>
<@sect title="Other operation systems">
Unfortunatelly, there is no shell script written for you. But you can still use the command-line tool. You will have to execute <@c><@r><FMPP>@r>/lib/fmpp.jar@c> with Java. Please refer to the documentation of the Java implementation you are using for more details. If it can't execute <@c>jar@c>-s, then you have to execute the <@c>fmpp.tools.CommandLine@> class with Java. For this, <@c><@r><FMPP>@r>/lib/fmpp.jar@c> must be in the so called "class path". Again, please refer to the documentation of the Java implementation you are using.
@sect> <@sect title="Notes for all operating systems">If you want to use FMPP as Ant task, copy the required jar files from <@c><@r><FMPP>@>/lib@> into the <@c>lib@> directory of your Ant installation (issuing <@c>ant install@c> from <@c><@r><FMPP>@>@> will do this for you), or ensure that the jars are in the <@c>CLASSPATH@> environment variable. Then, whenever you need the FMPP task in a project, add this line to your <@c>build.xml@c>:
<@prg>And then you can use the <@c><fmpp <@r>...@r>>@> task. @sect> <@sect title="Installing optional parts and custom extensions">
For the command-line tool, simply drop the jar file that contains the required classes into the <@c><@r><FMPP>@>/lib@> directory (or, into the Ant <@c>lib@c> directory, if you store <@c>fmpp.jar@c> there only). For the Ant task, either ensure that the required jars are in the <@c>CLASSPATH@c>, or drop the jars into the <@c>lib@c> directory of your Ant installation.
If you need XML support, you should use J2SE 1.4 or later. If you use earlier Java, then install some JAXP 1.2+/SAX 2.0+/DOM Level 2 implementation with name-space support, for example: Xerces (recommended) or Crimson. (Note that Ant comes with Xerces, so when you use the FMPP Ant task, the XML related classes will be available.)
XPath expressions will work only if Jaxen (recommended, use 1.1-beta-8 or later!) or Apache Xalan classes are available (Xalan was included with Sun J2SE 1.4, but not with 1.5).
@sect> <@sect title="Updating FreeMarker" anchor="updatingFreeMarker">FMPP comes with FreeMarker just for the sake of simplicity. You can replace FreeMarker with a later version as far as it is backward compatible with the version that FMPP comes with. For this, download the latest backward compatible FreeMarker release, and overwrite the <@c><@r><FMPP>@>/lib/freemarker.jar@c> with the <@c>lib/freemarker.jar@c> of the FreeMarker release. (Of course, if you are using the FMPP Ant task, you may need to replace the <@c>freemarker.jar@c> in the <@c>lib@c> directory of the Ant installation too.)
@sect> @page>