Running OT/J programs using ANT

This page describes how to run OT/J programs in the (old) JMangler mode. For the (newer) JPLIS mode see RunningInJplisMode.

See also: CompilingWithAnt.

Should you need to run an OT/J program outside the OTDT, the following steps should enable you to use ANT for this task:

  1. copy file ecotj_version.jar (see CompilingWithAnt) to .ant/lib/ relative to your home directory or use another mechanism of your choice to make this library known to ANT.
  2. gather the following information:
    • location where the OTDT is installed and set a an ANT properties like this
      <property name="otdt.path" value="/home/local/eclipse-otdt" />
      
    • version number of the otdt installed, must match the directory plugins/org.objectteams.otdt_1.2.3.200809221316 or similar, set ANT property:
      <property name="otdt.version" value="1.2.3.200809221316" />
      
    • version number of the otdt.runtime plugin, must match the directory plugins/org.objectteams.runtime_1.2.1.200808082021 or similar, set ANT property:
      <property name="otrt.version" value="1.2.3.200809221316" />
      
  3. copy the following constant block of property definitions:
    <property name="otdt.plugins" value="${otdt.path}/plugins" />
    <property name="otre.path" 
              value="${otdt.plugins}/org.objectteams.otdt_${otdt.version}/lib/otre.jar" />
    <property name="otj.runtime" 
              value="${otdt.plugins}/org.objectteams.runtime_${otrt.version}/otj/lib" />
    <property name="otre.classes" 
              value="${otre.path}:${otj.runtime}/jmangler/jars/JMangler-start.jar" />
    <property name="otre.defs" 
              value="-Dorg.cs3.jmangler.initfile=${otj.runtime}/callinTransformers.xml"/>
    <property name="otre.jvmarg"
              value="-Xbootclasspath/a:${otj.runtime}/jmangler/use/BCEL.jar:${otj.runtime}/jmangler/jars/JMangler-core.jar"/>
    
  4. use the following template for creating a Java taks that runs your program:
    <java fork="true"
          classname="org.cs3.jmangler.bootstrap.Start"
          classpath="${otre.classes}:${user.classpath}:bin">
        <jvmarg value="${otre.jvmarg}" />
        <jvmarg value="${otre.defs}" />
        <jvmarg value="-Dot.teamconfig=activation.txt" />
        <arg value="flightbooking.Main" />
    </java>
    

In this template adjust the following information:

  • in classpath only ${otre.classes} is mandatory, the rest is application specific.
  • the third jvmarg is optional and should point to a file containing the names of teams to be instantiated and activated at launch time.
  • the arg parameter holds your main class (you can't use a classname attribute for this).
  • program args would follow the main class as separate arg elements.

Please send an email to the mailing list, should you like a separate download for just those parts that are needed for compiling and running OT/J programs without the OTDT installed.