It's all about the answers!

Ask a question

Ant build toolkit for Java 1.4.2?


Alexej Penner (2121) | asked Feb 05 '09, 6:53 a.m.
Hi,

we have to use Java 1.4.2 for our build. However the delivered ant build toolkit is available for 1.5 only.

If I understand correctly this means for us:
- no parallel builds (must have)
- no results publishing (nice to have)
- no current activity logging (nice to have)

Is ant build toolkit also available for Java 1.4.2? At least at the moment we will stop our RTC evaluation :-(

Alexej

9 answers



permanent link
Don Weinand (7851) | answered Feb 05 '09, 1:38 p.m.
JAZZ DEVELOPER
The build tookit as well as many other parts of Jazz use Java 5.0 features
so it's definitely required. There is no 1.4 version available.

Don Weinand
Jazz Team Build

"alexej.penner" <alexej> wrote in message
news:gmek8a$8jp$1@localhost.localdomain...
Hi,

we have to use Java 1.4.2 for our build. However the delivered ant
build toolkit is available for 1.5 only.

If I understand correctly this means for us:
- no parallel builds (must have)
- no results publishing (must have)
- no current activity logging (nice to have)

Is ant build toolkit also available for Java 1.4.2? At least at the
moment we will stop our RTC evaluation :-(

Alexej

permanent link
Alexej Penner (2121) | answered Feb 06 '09, 6:51 a.m.
Thank you very much for clarification!

Just to mention: I believe Java 1.4.2 is still quite common in enterprise area.


Alexej

permanent link
David Brauneis (50611) | answered Feb 06 '09, 8:38 a.m.
JAZZ DEVELOPER
Alexj,

I was wondering if it would be possible for you to use the Java 5 JDK
and just set the source and target versions for the compiler - in fact,
I have worked on several projects where we had code for which some
pieces would run on Java 5 (server) and some pieces would run on Java
1.4.2 (client) and we built using a single version of the Java SDK.

Regards,
David Brauneis
IBM Rational Build Forge Architecture & Development


alexej.penner wrote:
Hi,

we have to use Java 1.4.2 for our build. However the delivered ant
build toolkit is available for 1.5 only.

If I understand correctly this means for us:
- no parallel builds (must have)
- no results publishing (must have)
- no current activity logging (nice to have)

Is ant build toolkit also available for Java 1.4.2? At least at the
moment we will stop our RTC evaluation :-(

Alexej


permanent link
Alexej Penner (2121) | answered Feb 09 '09, 1:37 p.m.
Hi David,

Unfortunately this will not help us :-(

1. From the technical point of view this doesn't always work.
Try to compile

CharSequence s = new String("abc");

StringBuffer sb = new StringBuffer();
sb.append(s);


with 1.5 (target 1.4) and run it on Java 1.4. I think you still need to (or must) use rt.jar from 1.4.

2. The second reason is a legal one: we will lose software producer support, since the framework version we have to use is only supported for Java 1.4.2 :-(


Alexej

permanent link
Anuerin Diaz (4112517) | answered Feb 10 '09, 1:02 a.m.
why not run jbe using the bundled IBM jdk (or another 1.5 JRE) and then outsource the build operation to a 1.4.2 VM? our JBE to build hand-off is an Ant target so it is a matter of writing another pseudo-target that will trigger the actual build process using another VM.

ciao!

permanent link
Alexej Penner (2121) | answered Feb 11 '09, 4:47 p.m.
do you mean just using exec? Yes, that could be a possible solution.

Alexej

permanent link
Anuerin Diaz (4112517) | answered Feb 13 '09, 3:44 a.m.
do you mean just using exec? Yes, that could be a possible solution.

Alexej


sort of. the java and javac ant tasks have built-in properties for specifying an alternate execution virtual machine. i usually reserve the exec task for system scripts since that (in my perception) is a last resort glue/task. :)

ciao!

permanent link
Alexej Penner (2121) | answered Feb 13 '09, 5:36 a.m.
the java and javac ant tasks have built-in properties for specifying an alternate execution virtual machine.


As I already answered to David (see above) this doesn't always work. Anyway I will try the "exec" way as far as I have some time...

Alexej

permanent link
Anuerin Diaz (4112517) | answered Feb 16 '09, 1:24 a.m.
the java and javac ant tasks have built-in properties for specifying an alternate execution virtual machine.


As I already answered to David (see above) this doesn't always work. Anyway I will try the "exec" way as far as I have some time...

Alexej

david's answer was to use the compatibility directives wherein you just state that the codebase is for a 1.4.x VM but you are still using the 1.5 VM to execute. mine was to use a real 1.4 VM as you fork the execution so that you are still able to use the 1.5 VM for jbe but not for compilation. it would be something like this:



Note: The code tag for the forum is shot so just replace < and > with the less than and greater than symbols to get the XML snippet.

<property name="JDK-1.4" value="C:/jdk/sun1.4.11/"/>

<target name="compile">

<!-- Up to this point, the Ant is using the default 1.5 VM -->

<javac fork="true" executable="${JDK-1.4}/bin/java.exe"
...>
<!-- make sure the classpath is pointed to the 1.4 VM -->
</javac >

</target >



You can read the manual for the Ant Javac task (the second example on top of the Jikes Notes) here. Basically the idea is that everything uses the default JDK but you switch to a different JDK (provider and/or version) when you begin the compilation step.


http://ant.apache.org/manual/CoreTasks/javac.html

ciao!

Your answer


Register or to post your answer.


Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.