ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Bodewig <>
Subject Re: Conditional ANT building
Date Fri, 10 Aug 2001 05:35:09 GMT
On Thu, 9 Aug 2001, T. Master <> wrote:

> I was thinking of something within my init target that would check
> the java.runtime.version.  Then I can enforce within my buildfile
> what jdk version should be used.

Take a look at ant's own build file to see a way to check the JDK
version (the <available> tasks that set properties jdk1.2+ through

Something like

  <target name="check_for_optional_packages">
    <available property="jdk1.2+" classname="java.lang.ThreadLocal" />

  <target name="enforce-jdk1.2+" depends="check_for_optional_packages"
    <fail message="Need JDK 1.2 or higher to build" />

should do the trick. Simply make all your targets depend on


View raw message