The installation is a three-steps process: install a Java Virtual Machine, unpack ContactCenters, and set up the environment. We will show these steps in more details.
If ContactCenters is already installed, an update can be performed simply by unpacking the new version at the same location as the old version. There is no need to redo the Java installation and environment setup.
Before using ContactCenters, one should install a Java Virtual Machine. The recommended JVM is Oracle's Java Runtime Environment, and can be found on the Oracle's Java SE downloads page. It is sufficient to download and install JRE for using the precompiled simulator, but JDK is necessary for programming using the ContactCenters library, which was used to build the generic simulator.
Note that GCJ, the default Java Virtual Machine bundled with many Linux distributions, is not compatible with ContactCenters. However, ContactCenters might work with IcedTea which is under development.
One might test the installation of Java using a console. A console can be accessed several ways. For example, the GNOME Terminal can be accessed from GNOME by using the Terminal command in menu Applications, submenu Accessories. This opens a window allowing the user to type commands.
The console runs a shell which accepts commands corresponding to program names with arguments, separated by spaces. After writing any command on the console, the user needs to press the Enter key to execute it. The command java -version may be used to verify that the Java Virtual Machine is properly installed. Here, the program name is java while -version is an argument passed to the java program. The above command should produce an information message similar to the following one.
java version "1.6.0" Java(TM) SE Runtime Environment (build 1.6.0-b105) Java HotSpot(TM) Client VM (build 1.6.0-b105, mixed mode, sharing)
The displayed version should at least be 1.6.0. Java is not properly installed on the system if the above command produces an error message indicating that java is not a recognized command.
The exit command can be used to leave the console.
For some GNU/Linux distributions, Java can be installed easily by using the builtin package manager. For example, with Ubuntu 7.04 and newer versions, the user simply needs to install the sun-java6-jdk package using the Synaptic package manager. The user might also have to type the command sudo update-java-alternatives -s java-6-sun on a console to set the default VM to Sun's rather than to GCJ. Using such an automated procedure to install JDK is recommended.
If JDK is not available as a package for one's Linux distribution, or if a more recent JDK than the one offered by the Linux distribution is needed, the manual installation procedure can be used. The following steps summarizes this generic installation process for the Oracle's JVM. The Web site Installation Notes provides detailed instructions for installing Java on GNU/Linux.
This should correspond to the first Download button on the page.
If the command uname -m displays x86_64, one should instead select Linux x64 as the platform.
For example, the file can be called /tmp/jdk-6u2-linux-i586.bin.
mkdir /usr/local/java cd /usr/local/java chmod a+x /tmp/jdk-6u2-linux-i586.bin /tmp/jdk-6u2-linux-i586.bin
One may need to adapt the filenames and directories. It can also be necessary to prefix every line with sudo followed by a space to run the commands as root.
For example, with Fedora Core, this can be done by creating a /etc/profile.d/java.sh file with contents
#/bin/sh export JAVA_HOME=/usr/local/java/jdk1.6.0_02 export PATH=$JAVA_HOME/bin:$PATH
The path assigned to JAVA_HOME must be replaced with the true location of the JDK. For Ubuntu, this must be added to /etc/bash.bashrc.
unzip contactcenters-<DATE>.zip
This will create a contactcenters subdirectory containing all files of the distribution in the current directory. For example, if the command is called while the current directory is /usr/local/java, the base directory of ContactCenters will be /usr/local/java/contactcenters.
Note: If the library is unpacked by the root user to be installed for every user on a machine, the root user may need to adjust file permissions.
When using ContactCenters or any other third-party Java library, the user needs to tell Java how to locate the classes forming the library by configuring the CLASSPATH environment variable. Moreover, for convenience scripts to be used to call the simulator, the PATH environment variable must also be altered. Environment variables are properties passed implicitly to any executed program, including the Java Virtual Machine. The procedure to set these variables depends on the used shell. Most recent distributions of GNU/Linux use Bash by default, which is a kind of Bourne shell. Several UNIX flavors also use some types of Bourne shell. Older UNIX and GNU/Linux systems use C-Shell by default. The echo $SHELL command can be used to obtain the currently used shell.
For convenience, scripts are available to setup the environment for the user if the CCHOME environment variable is set prior to calling them. The following commands can therefore be used to setup the environment.
export CCHOME=<path to ContactCenters> . $CCHOME/Contactcenters.sh
Here, <path to ContactCenters> must be replaced by the absolute path to the unpacked contactcenters subdirectory, for example /usr/local/java/contactcenters. The command lines should be added to an appropriate startup script for convenience; for example, in the file .bashrc in the home directory.
setenv CCHOME <path to ContactCenters> source $CCHOME/Contactcentersrc
Here, <path to ContactCenters> must be replaced by the absolute path to the unpacked contactcenters subdirectory. The command lines should be added to an appropriate startup script for convenience; for example, in the file .cshrc in the home directory.
If a different shell is used, the environment must be set up manually. This requires contactcenters.jar, ssj.jar, and colt.jar, located in the lib subdirectory of ContactCenters, to be referred to in the CLASSPATH environment variable. This variable is a colon-separated list of paths being searched by the Java Virtual Machine for classes. Moreover, the bin subdirectory of ContactCenters must be referred to in the PATH environment variable. This variable is a colon-separated list of paths being searched by the shell when a program is loaded.
Some Java Integrated Development Environments (IDEs) such as Eclipse and NetBeans do not use the standard CLASSPATH environment variable. These environments must be notified about the location of colt.jar, ssj.jar and contactcenters.jar manually. The procedure used to set these parameters can be found in the documentation of the specific Java IDE. If the archives cannot be located, the ContactCenters programs will not compile or not execute properly.
If Java 6 is properly installed as tested above, the command mskcallcentersim may be entered on the console to test the installation of ContactCenters. After pressing Enter for validating the command, the user receives an information message similar to this:
Usage: java umontreal.iro.lecuyer.contactcenters.msk.CallCenterSim <call center data file name> <experiment parameter file> [<output file name>]
If this message appears, the installation is finished. Otherwise, the user needs to verify if the Java Virtual Machine is properly installed, and the environment variables are set.
The command cd $CCHOME/msk can be used to switch to the ContactCenters directory in order to load sample parameter files.
Here are the most common errors:
export PATH=$PATH:$CCHOME/binto set up the variable temporarily in a Bourne shell.
export CLASSPATH=.:$CCHOME/lib/contactcenters.jarin a Bourne shell to set up the variable temporarily to run the simulator. The error can also appear if Java 5 is used instead of Java 6.