Running an OT/J application requires a byte code weaver for binding roles into their bases. As of version 2.3, the OTDT ships with two distinct weavers with the following properties:
In short: for the time being the traditional OTRE is still the default weaver, recommended for all productive use. For now the new OTDRE is needed only when working with Java 8. It will be further improved in the near future and may fully replace the OTRE in a future version.
Initial configuration of the target weaving scheme happens in the
New Object Teams Project Wizard.
The corresponding compiler option is intentionally not yet
surfaced in the project preferences, because for productive use
it is strongly encouraged to still use the traditional OTRE.
For experiments requiring to switch the target weaving scheme, please
open the file .settings/org.eclipse.jdt.core.prefs
in your project and edit/add the following line:
org.eclipse.objectteams.otdt.compiler.option.weaving_scheme=OTDRE
The above line enables the new OTDRE, whereas a value of "OTRE" switches back to the traditional OTRE.
This configuration is evaluated by the compiler and when launching an OT/J application.
Since the OT/J compiler performs some preparation for the respective weaver,
it has to generate different byte code formats, depending on the targeted weaving scheme.
As a consequence, switching from one weaving scheme to the other requires a full
recompilation of all OT/J code involved. The runtime will detect if it encounters
any class files compiled for an incompatible weaving scheme, signaled by throwing
UnsupportedClassVersionError
.