Installing the AspectJ Distributed Java Virtual Machine (AJVM)

Document Sample
Installing the AspectJ Distributed Java Virtual Machine (AJVM) Powered By Docstoc
					Installing the AspectJ Distributed Java Virtual Machine (AJVM)
1. Host and Utility Requirements
Currently, the AspectJ Distributed Java Virtual Machine requires the host computer to have an
i386-compliant instruction set running Linux 2.4. The restriction of an i386 host arises from the
Jikes Research Virtual Machine, and in particular because of its host-dependent compilers. The
system has
been run with Linux Kernel 2.4.9 and 2.4.20.

An independent (host) version of Java must be installed in a directory $java.

SUN JDK v1.3.1_13, available at and installed
in /usr/java/jdk1.3.1_13

Although the IBM SDK v1.3.1 is available we have experienced problems with it.

You will also need the following four other tools which are necessary to build the system:

AspectJ – you will need AspectJ to compile this version of the DJVM. We used version 1.0.6
(which does source code weaving) which is available at

Kshell - public domain ksh version 5.2 or later, normally installed in /bin/ksh, available with
Redhat (and other) Linux distributions. The majority of scripts used in the JikesRVM use ksh.

Jikes Java compiler - jikes version 1.18 or later, available at, normally installed in
/usr/bin/jikes, is a Java source compiler written in C and independent of any Java runtime
libraries, used to compile the JikesRVM source.
Note: Version 1.18 is the only version which we can guarantee will work. We have experienced
problems with version 1.13 through 1.17.

Unzip - public domain unzip by Info-Zip, version 5.50 or later (although earlier version will
probably work).

2. Building the AspectJ Distributed Java Virtual Machine
Please Note: You will need to increase the memory required (the default is 64MB) by the
AspectJ 1.0 compiler. To do so, edit the ajc script to say -Xmx128M as seen below.

"$JAVA_HOME/bin/java" -classpath
"$ASPECTJ_HOME/lib/aspectjtools.jar:$JAVA_HOME/lib/tools.jar:$CLASSPATH" -
Xmx128M "$@"

The following environment variables (these are examples, use your own user account) should
be set (you will need to edit i686-pc-linux-gnu for your configuration):

ASPECTJ1_HOME                         /home/jbaldwin/aspectj1.0

(wherever you plan to download and extract this project to)
RVM_DOWNLOAD                 /home/jbaldwin/Desktop/aspectdjvmdownload
RVM_ROOT                     /home/jbaldwin/aspectrvmRoot
RVM_BUILD                    /home/jbaldwin/aspectrvmBuild
RVM_TARGET_CONFIG                   $RVM_ROOT/rvm/config/i686-pc-linux-gnu
RVM_HOST_CONFIG                     $RVM_ROOT/rvm/config/i686-pc-linux-gnu
RVM_HOST_JAVA_HOME                  $java
PATH                                $RVM_ROOT/rvm/bin:
CLASSPATH                           .:$RVM_BUILD/RVM.classes:
RSH                                 either ssh or rsh

These environment variables are also necessary for configuring and building the Jikes Distributed
Java Virtual Machine, as well as compiling and executing applications for the AJVM.

Obtain and unpack the file AJVM.tar.gz. This tar file includes jikesrvm-2.2.0.tar.gz which
has been modified from the original so that it would compile with Sun's Java compiler. You need
this version and not any version downloaded from the official site.

For your convenience, the extra files that this build depends on have been made available for
download from the project page. These need to be in the same directory as the unpacked project tar


3. Building the AspectJ DJVM
The Distributed JVM source tree is built using the script DJVMinstall. This script creates the
standard non-distributed Jikes RVM source tree in the $RVM_ROOT directory.

Next, run the script DJVMbuildClassPathJar. This should be run, from the same directory,
immediately after DJVMinstall has been run. This script expects the file classpath-
0.05.tar.gz to be in the current working directory.

Warning: During the course of the build of the classpath libraries, a few unsightly warning
messages, may be observed. However, the library build should, nevertheless, succeed.

Once the above steps have been completed, the dJVM may be built largely in the same way as the
standard non-distributed JVM is built.

  Change directory to $RVM_ROOT/rvm/bin

  Run the jconfigure script, giving as a parameter, the configuration file

  Change directory to $RVM_DOWNLOAD

  Run the copyFilesForBuild script

  Add the aspects folder to the RVM.sources script, for example:

  Change directory to $RVM_BUILD

  Execute the script jbuild
4. Running the DJVM
To run the dJVM non distributedly, use the command $RVM_ROOT/rvm/bin/rvm.

To run distributedly, continue reading:

Disable firewall (on Linux and on router)

To check your IP addresses:


Next, create DJVMHosts file with the IP address of each machine on a separate line. eg:

The first line should be the IP for the local host.

Run "rvmCluster className" from the same directory as is the DJVMHosts file or

"rvmCluster -DJVMHostsFile=/home/jbaldwin/aspectrvmRoot/rvm/bin/DJVMHosts

* You must have an account and home directory with the same username and home directory path
as the master node.

* You must also have $RVM_ROOT and $RVM_BUILD with the same folder names and installations on
the other machine AND under the same home user account.