<fail message="Not a Java 1.6+">
  <not><available classname="java.util.ServiceLoader"/></not>
</fail> 

(see target "check_for_optional_packages" in Ants own buildfile)


Jan

>-----Ursprüngliche Nachricht-----
>Von: KARR, DAVID (ATTCINW) [mailto:[email protected]] 
>Gesendet: Montag, 21. Dezember 2009 00:45
>An: Ant Users List
>Betreff: Best way to have script fail if not using new enough JDK?
>
>I need to have my Ant script abort if the current JDK version is older
>than the project needs (1.6).
>
>I noticed a "JavaVersionTask" sample at <http://onjava.com/lpt/a/6264>
>which would probably help, but I wonder if there's an easier way since
>that article was written (4 years ago).
>
>I can see the possibility of doing this with a Groovy 
>scriptcondition to
>set the property to check, but I can't figure out how I can get Groovy
>to set Ant properties, or to return a value that would set the 
>property.
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: [email protected]
>For additional commands, e-mail: [email protected]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to