The script provided here gave a great way to check if Ant is using Java 6.
<?xml version="1.0" encoding="UTF-8"?>
<project name="project" default="default">
<target name="default" depends="javaCheck" if="isJava6">
<echo message="Hello, World!" />
</target>
<target name="javaCheck">
<echo message="ant.java.version=${ant.java.version}" />
<condition property="isJava6">
<equals arg1="${ant.java.version}" arg2="1.6" />
</condition>
</target>
</project>
However, I have good reason to think the next person holding my position may not be a Java programmer and I want to make sure the builds don't fail because of Java 7. Is there any way to pick apart a String or otherwise ask for Java 6 or higher?
Beware, the ant.java.version returns the JDK version with which Ant is built till Ant 1.6.5...
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