The installation procedures explained here are general and refer to installing all the components of the Moses toolkit. Depending on the usage of the system only some of the components might need to be installed in some particular case. We strongly recommend, however that the whole toolkit is installed as directed here.

Prerequisites

Moses is implemented entirely in Java. In order to install and run Moses, one needs to have the following components already installed. It is also expected that the user is minimally comfortable to using the following:

  • An unzipping tool such as WinZip (for Windows) or Java jar (for Unix/Windows) in order to uncompress the distribution;
  • Java SDK in order to support the runtime system; Note that that a Java Runtime Environment (JRE) installation is not sufficient for running Moses. At runtime, Moses makes use of the Java compiler, thus the need for the JavaSDK components.
  • Knowledge of setting and modifying environments variables (PATH and CLASSPATH).

Installation steps

Step 1

Create an installation directory installationdir. This is a directory where the runtime system will be located.

Step 2

Identify the java installation directory javadir. Usually, it is /usr/java1.4/ on Unix, or C:\Program Files\J2SDK\jdk1.4.0\ on Windows.

Step 3

Download the Moses distribution, and place it in the newly created installationdir.

Step 4

Extract the content of the Moses distribution archive and place it in the same directory. If WinZip is available, use its GUI. If using jar tool, acquire a terminal (or press run and execute cmd in Windows) and perform the following steps:

> cd installationdir
> ls
moses.jar
> javadir/bin/jar xvf moses.jar ./
or simply : > jar xvf moses.jar ./
if javadirbin/ directory is in the PATH environment variable)
The content of the installationdir directory should be :
moses.jar
xerces.jar
jinni.jar
moses
After this step the original moses.jar archive is not required anymore, and it can be set aside.

Step 5

Identify the location of tools.jar file. This file is part of any standard java SDK installation and it contains java classes required for the dynamic compilation of java laws. Usually the location is javadir/lib/tools.jar . Make sure that this file is the same version (or it belongs to the same release) as the java executable you are using currently.

Step 6

Set the CLASSPATH environment variable to point to the following items:
.
installationdir/
installationdir/jinni.jar
installationdir/xerces.jar
javadir/tools.jar

In Windows, go to (Start, Settings) Control Panel. Then double click on System, Advanced tab, Environment Variables. Check either the User or the System variables for the CLASSPATH entry. If this entry already exists, modify it. If not, create a new entry with this name, by pressing New... on User variables. The variable value should contain: javadir\lib\tools.jar;installationdir\jinni.jar;installationdir\xerces.jar;installationdir\;.

In Unix, depending on the shell being used and the login script, set the classpath as follows: in .cshrc file add or modify the CLASSPATH entry such that it contains:
setenv CLASSPATH installationdir:installationdir/jinni.jar:installationdir/xerces.jar:javadir/tools.jar:.

Step 7

Try the new installation. In Windows, open a new command terminal (Run, then type cmd). In Unix, open a new terminal (such that the new CLASSPATH settings will be loaded). Type
> java moses.Controller

The terminal should read the following output:
Controller starts (use -help option for help)
host:9000 is sandboxed
Location of the configuration files is:
installationdir/moses/controllerConf

If the output is this, then the installation is complete. Congratulations!

If the output is
java: Command not found.
or: 'JAVA' is not recognized as an internal or external command,
operable program or batch file.
then make sure that the javadir/bin is indeed the java installation directory. Alternatively place this value in the PATH environment variable.
If the output is
Exception in thread "main" java.lang.NoClassDefFoundError: moses/Controller
then make sure that the installationdir\ entry is the actual installation directory, and it is present in the classpath environment variable.