# Running Object Teams programs

Technically running an Object Teams program involves a special runtime environment (the OTRE - Object Teams Runtime Environment) which provides fundamental classes and performs load-time weaving for connecting aspects with their bases. All this is hidden as to make running Object Teams programs as easy as running Java programs. Only when targeting Java 8, selection of the appropriate target weaving scheme is necessary.

Previous versions of the OTDT introduced specific launch types ( Object Teams Application, Object Teams Eclipse Application OT/Equinox Framework) which are no longer supported.

For launching OT/J programs use any of the launching techniques offered by Eclipse: You may, e.g., invoke a Run As/Debug As option from a context menu or use one of the run/debug tool bar buttons. From here just select one of the standard launch configuration types:

- Java Application
- Remote Java Application
- JUnit
- JUnit Plug-in Test
- Eclipse Application
- OSGi Framework

All these launches now consistently provide one additional checkbox, which is shown next to where the Runtime JRE is configured.

For Java Applications (, ) this checkbox is found on the `JRE` tab:

- If the new option is checked the application will be launched with the Object Teams Runtime Environment (OTRE) enabled which is needed to weave callin bindings into base classes. Conversely, disabling the OTRE lets you run an OT/J application with all callin-bindings disabled. But note that a few more OT/J mechanisms will not work either (like decapsulation).
- For OT/J projects this option is enabled by default.
- If Enable OTRE is checked an additional `Team Activation` tab will be shown.
  (If a launch configuration was opened while the OTRE was disabled, you need to re-open this configuration (e.g., unselect and select) in order for the new tab to show.)

For Remote Debugging of a java applications () this checkbox is found on the `Connect` tab:

For launching a Runtime Workbench (, ) the new checkbox is right on the main page:

For OSGi Framework launches () the runtime environment is configured on the `Settings` tab:

## Team activation:

I you wish to compose your program from a base application and a number of aspects, you may use a launch configuration to select which aspects should be included. Use the tab Team Activation to select existing teams and put them into the desired order.

The effect is that each team in the list will be instantiated and activated before the main method of the program executes. This can actually be observed if Stop in main is checked for debugging: the program will actually stop before entering main, the next step will perform all pending team instantiations/activations and only then the program starts (You might want to use the team monitor to observe team instantiation/activation).

Since a team can intercept method calls in a base application simply adding a team to an existing application can indeed produce different behavior.