You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by "Holliday, Donald B. (LNG-CSP)" <Do...@lexisnexis.com> on 2004/02/09 23:20:18 UTC

No execute attribute on the task

The <javac> task has an "execute" attribute that you can set to tell ant
exactly which java compiler you want to compile your code.  This allows you
to compile the same code against different compilers.

The <jar> task does not have an "execute" attribute.  If I run ant with
j2sdk 1.4.2 it appears that ant will create my jar file using the jar tool
that shipped with 1.4.2.

Seems like an "execute" attribute should be available on the <java> and
<jar> tasks also so that we could keep all of the tools running from a
consistent JDK/SDK.

We still maintain code compiled with JDK 1.2.2.  If I compile the code using
the 1.2.2 compiler, and then jar them up using the 1.4.2 jar tool, am I
guaranteed that JDK 1.2.2 will be able to read the jar file correctly?

The workaround, of course, is to wrap ant in a script that sets JAVA_HOME
before running ant, but that's just more code to write and maintain.

Thanks,

Donald Holliday

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: No execute attribute on the task

Posted by Stefan Bodewig <bo...@apache.org>.
On Mon, 9 Feb 2004, Donald B. Holliday
<Do...@lexisnexis.com> wrote:

> The <jar> task does not have an "execute" attribute.  If I run ant
> with j2sdk 1.4.2 it appears that ant will create my jar file using
> the jar tool that shipped with 1.4.2.

No, it uses a zip library of its own and doesn't run any jar
executable at all.

Stefan

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: No execute attribute on the task

Posted by Antoine Lévy-Lambert <an...@antbuild.com>.
Holliday, Donald B. (LNG-CSP) wrote:

>The <jar> task does not have an "execute" attribute.  If I run ant with
>j2sdk 1.4.2 it appears that ant will create my jar file using the jar tool
>that shipped with 1.4.2.
>
>  
>
1) the <jar> task of ant is always in process,

>We still maintain code compiled with JDK 1.2.2.  If I compile the code using
>the 1.2.2 compiler, and then jar them up using the 1.4.2 jar tool, am I
>guaranteed that JDK 1.2.2 will be able to read the jar file correctly?
>
>  
>
2) there are no compatibility issues concerning which JDK version does 
the jarring, at least among Sun JDKs.
For instance you can jar with ant under JDK 1.4 and run under JDK 1.2 
(as long as your *sources* do not use JDK 1.4 features).

>The workaround, of course, is to wrap ant in a script that sets JAVA_HOME
>before running ant, but that's just more code to write and maintain.
>
>  
>
You do not need to do anything like that.

Cheers,
Antoine


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org