My ant script only works with version >=1.8. I want to check the version in the script, so that it displays error if a lesser version installed.
Window > Preferences > Ant > Runtime.1 are grouped under the Ant Home Entries item. To change the Ant Home entries, click on the Ant Home... button and choose the Ant installation you wish to use. After you change the Ant classpath, all future Ant builds will use the updated version instead of the default.
1. Which version of Java is required to run Apache Ant? You will need Java installed on your system, version 1.8 or later required. The later the version of Java, the more Ant tasks you get.
ANT stands for Another Neat Tool. It is a Java-based build tool from computer software development company Apache.
Here's a code snip that may help:
<property name="version.required" value="1.8" />
<target name="version_check">
<antversion property="version.running" />
<fail message="FATAL ERROR: The running Ant version, ${version.running}, is too old.">
<condition>
<not>
<antversion atleast="${version.required}" />
</not>
</condition>
</fail>
</target>
<target name="doit" depends="version_check">
<echo level="info" message="The running version of ant, ${version.running}, is new enough" />
</target>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With