Differences between revisions 5 and 6
Revision 5 as of 2007-09-01 09:41:42
Size: 3457
Editor: cm74-182
Revision 6 as of 2009-09-20 23:00:35
Size: 3459
Editor: localhost
Comment: converted to 1.6 markup
Deletions are marked like this. Additions are marked like this.
Line 2: Line 2:
you need to use a bytecode weaver like [http://retroweaver.sourceforge.net/ Retroweaver]. you need to use a bytecode weaver like [[http://retroweaver.sourceforge.net/|Retroweaver]].

Trinidad use specific java 5 APIs so if you need to run Trinidad application in older you need to use a bytecode weaver like Retroweaver.

Build Trinidad for JDK 1.4

Use Maven

Start the Trinidad-build with -Dbuild.jdk14.compatible=true.

In the project where you want to use Trinidad in the 1.4 version, declare the dependencies as such - don't forget to include the retrotranslator library:

        <!-- Apache MyFaces Trinidad (backported version) -->
             <!-- Exclude the trinidad-api dependency as 
                        it would include the JDK5 version -->

        <!-- Retrotranslator runtime library -->

You are done - your project should work perfectly with JDK1.4 now. One final remark - do not use the retroweaved trinidad-jar-files with JDK1.5!

Alternatively, Do it yourself...

  • Dowload Retroweaver
  • Unzip Retroweaver in directory
  • Create a directory named ext and Compile this class in it (if you use a jdk 5 compiler use -target 1.4 -source 1.4 command line parameter):

package net.sourceforge.retroweaver.runtime.java.lang;

public class ThreadLocal_
        public static void remove(ThreadLocal threadLocal)

  • Weave Trinidad (for example with ant) (create weaved directory before executing this ant script)

<project name="retroweave.trinidad" default="weave" basedir=".">

        <property name="retroweaver.home" location="your unziped retroweaver directory"/>
        <property name="trinidad.version" value="1.0.0-incubating"/>
        <property name="trinidad.api.jar.name" value="trinidad-api-${trinidad.version}.jar"/>
        <property name="trinidad.impl.jar.name" value="trinidad-impl-${trinidad.version}.jar"/>

        <taskdef name="retroweaver" classname="net.sourceforge.retroweaver.ant.RetroWeaverTask">
                        <fileset dir="${retroweaver.home}/lib" includes="**/*.jar" />
                        <fileset dir="${retroweaver.home}/release" includes="**/*.jar" />
                        <pathelement location="${retroweaver.home}/ext"/>

        <target name="weave" >
                <retroweaver inputjar="${trinidad.api.jar.name}" outputjar="./weaved/${trinidad.api.jar.name}" target="1.4" verify="true"/>
                <retroweaver inputjar="${trinidad.impl.jar.name}" outputjar="./weaved/${trinidad.impl.jar.name}" target="1.4" verify="true"/>

For running this solution you need to package your application with Trinidad weaved jar, retroweaver-rt-2.0.jar, backport-util-concurrent.jar and the ThreadLocal_ class

Trinidad_and_JDK_1.4 (last edited 2009-09-20 23:00:35 by localhost)